|
@@ -76,7 +76,8 @@ export async function servicesResponse() {
|
|
|
...new Set([discoveredServices.map((group) => group.name), configuredServices.map((group) => group.name)].flat()),
|
|
|
];
|
|
|
|
|
|
- const mergedGroups = [];
|
|
|
+ const sortedGroups = [];
|
|
|
+ const unsortedGroups = [];
|
|
|
const definedLayouts = initialSettings.layout ? Object.keys(initialSettings.layout) : null;
|
|
|
|
|
|
mergedGroupsNames.forEach((groupName) => {
|
|
@@ -90,12 +91,12 @@ export async function servicesResponse() {
|
|
|
|
|
|
if (definedLayouts) {
|
|
|
const layoutIndex = definedLayouts.findIndex(layout => layout === mergedGroup.name);
|
|
|
- if (layoutIndex > -1) mergedGroups[layoutIndex] = mergedGroup;
|
|
|
- else mergedGroups.push(mergedGroup);
|
|
|
+ if (layoutIndex > -1) sortedGroups[layoutIndex] = mergedGroup;
|
|
|
+ else unsortedGroups.push(mergedGroup);
|
|
|
} else {
|
|
|
- mergedGroups.push(mergedGroup);
|
|
|
+ unsortedGroups.push(mergedGroup);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- return mergedGroups.filter(g => g);
|
|
|
+ return [...sortedGroups.filter(g => g), ...unsortedGroups];
|
|
|
}
|