Skip to content

Commit 45fa6c7

Browse files
committed
Fix getconfig after API clean-up
1 parent 8e995d5 commit 45fa6c7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

assets/webconfig/js/content_index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ $(document).ready(function () {
147147
}
148148

149149
// Find the instance with the matching id and add its settings
150-
const instance = instances.find(inst => inst.id === instanceId);
150+
const instance = instances?.find(inst => inst.id === instanceId);
151151
if (instance?.settings) {
152152
Object.assign(legacyConfig, instance.settings);
153153
}

assets/webconfig/js/hyperion.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,12 @@ const requestServerConfig = {
378378
},
379379
};
380380

381-
// Handle instances: remove "null" if present and add to filter if not empty
382-
if (instances.length) {
383-
filter.configFilter.instances = { ids: instances };
381+
if (instances == null) {
382+
filter.configFilter.instances = null; // Return no instances
383+
} else if (instances.length > 0) {
384+
filter.configFilter.instances = { ids: instances }; // Return selected instances
385+
} else {
386+
filter.configFilter.instances = instances; // Return all instances
384387
}
385388

386389
if (instanceTypes.length > 0) {

0 commit comments

Comments
 (0)