Fix review findings in file picker

This commit is contained in:
“Naeel”
2026-09-05 10:00:14 +03:00
parent 6fea5bce49
commit 8f775e34a9
6 changed files with 67 additions and 19 deletions
+2 -2
View File
@@ -2,8 +2,8 @@ export function addFileWithDedup(state, fileNode) {
const accept = (node) => {
if (node.kind === 'file') {
const key = `${node.path}\u0000${node.file.size}`;
if (state.fileMeta.has(key)) return null;
state.fileMeta.set(key, node.id);
if (state.fileKeys.has(key)) return null;
state.fileKeys.add(key);
return node;
}
node.children = node.children.map(accept).filter(Boolean);