Skip to content

Commit 662c3b4

Browse files
committed
Ensure UI getConfig always get instances
1 parent c7fbbc7 commit 662c3b4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

assets/webconfig/js/content_index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ $(document).ready(function () {
158158
let instanceId = window.currentHyperionInstance;
159159
const config = event.response.info;
160160
const { instanceIds } = config;
161-
if (instanceIds.length !== 0) {
161+
162+
if (Array.isArray(instanceIds) && instanceIds.length !== 0) {
162163
if (!instanceIds.includes(window.currentHyperionInstance)) {
163-
// If instanceID is not valid try to switch to the first enabled or or fall back to the first instance configured
164+
// If instanceID is not valid try to switch to the first enabled or fall back to the first instance configured
164165
const { instances } = config;
165166

166167
const firstEnabledInstanceId = instances.find((instance) => instance.enabled)?.id;
@@ -170,7 +171,6 @@ $(document).ready(function () {
170171
} else {
171172
instanceId = window.currentHyperionInstance = instanceIds[0];
172173
}
173-
174174
}
175175
}
176176

assets/webconfig/js/hyperion.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,12 @@ const requestServerConfig = {
359359
createFilter(globalTypes = [], instances = [], instanceTypes = []) {
360360
const filter = {
361361
configFilter: {
362-
global: { types: globalTypes },
362+
global: { types: globalTypes }
363363
},
364364
};
365365

366366
// Handle instances: remove "null" if present and add to filter if not empty
367-
if (instances.length && !(instances.length === 1 && instances[0] === null)) {
367+
if (instances.length) {
368368
filter.configFilter.instances = { ids: instances };
369369
}
370370

0 commit comments

Comments
 (0)