Fix review findings in file picker
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user