Skip to content

Commit ba0c96c

Browse files
fix: handle admin state access correctly
1 parent a8f9617 commit ba0c96c

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frosh/tools",
3-
"version": "3.1.1",
3+
"version": "3.1.2",
44
"description": "Provides some basic things for managing the Shopware Installation",
55
"type": "shopware-platform-plugin",
66
"license": "MIT",
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
import './frosh-tools.scss';
22
import template from './template.twig';
33

4-
const { Component } = Shopware;
4+
const {Component} = Shopware;
55

66
Component.register('frosh-tools-index', {
7-
template,
8-
computed: {
9-
elasticsearchAvailable() {
10-
if (Shopware.Store && Shopware.Store.get('context')) {
11-
return (
12-
Shopware.Store.get('context').app.config.settings
13-
?.elasticsearchEnabled || false
14-
);
15-
} else {
16-
return (
17-
Shopware.State.get('context').app.config.settings
18-
?.elasticsearchEnabled || false
19-
);
20-
}
21-
},
7+
template,
8+
computed: {
9+
elasticsearchAvailable() {
10+
try {
11+
return (
12+
Shopware.Store.get('context').app.config.settings
13+
?.elasticsearchEnabled || false
14+
);
15+
16+
} catch {
17+
return (
18+
Shopware.State.get('context').app.config.settings
19+
?.elasticsearchEnabled || false
20+
);
21+
}
2222
},
23+
},
2324
});

0 commit comments

Comments
 (0)