Fix environment sorting

This commit is contained in:
Gregory Schier
2025-11-03 13:53:41 -08:00
parent 0c54b481fb
commit 749ca968ec
2 changed files with 2 additions and 7 deletions

View File

@@ -331,12 +331,7 @@ const treeAtom = atom<TreeNode<TreeModel> | null>((get) => {
const parent = root.children?.[0];
if (baseEnvironments.length <= 1 && parent != null) {
const sortedEnvironments = [...subEnvironments].sort((a, b) => {
if (a.sortPriority === b.sortPriority) return a.updatedAt > b.updatedAt ? 1 : -1;
else return a.sortPriority - b.sortPriority;
});
parent.children = sortedEnvironments.map((item) => ({
parent.children = subEnvironments.map((item) => ({
item,
parent,
depth: 1,