fix(renderer): drop redundant ternary, add loadChildren idempotence test

This commit is contained in:
2026-06-05 14:50:56 +05:30
parent fa5a46d5ac
commit 17f318dd75
2 changed files with 24 additions and 2 deletions
+2 -2
View File
@@ -46,7 +46,7 @@ function entryToNode(entry: FileEntry): FileNode {
name: entry.name,
path: entry.path,
isDirectory: entry.isDirectory,
children: entry.isDirectory ? null : null,
children: null, // lazy: start unloaded; loadChildren populates this
};
}
@@ -97,7 +97,7 @@ export const useFileStore = create<FileState>()(
let found = false;
updateNode(tree, dirPath, (node) => {
if (node.loaded) return;
if (node.loaded === true) return;
found = true;
});
if (!found) return;