mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
fix(renderer): drop redundant ternary, add loadChildren idempotence test
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user