const filteredPaths = paths.filter(path => { const alreadyAdded = Object.values(files).find(file => { return file.path === path }) return !alreadyAdded })
const importFilesArr = filteredPaths.map(path => { return { id:uuidv4(), title: basename(path,extname(path)), path, } })
console.log(importFilesArr);
const newFiles = {...files,...flattenArr(importFilesArr)} // console.log(newFiles);
setFiles(newFiles) saveFilesToStore(newFiles) if(importFilesArr.length > 0){ remote.dialog.showMessageBox({ type:'info', title:`导入成功`, message:`成功导入${importFilesArr.length}了个文件`, }) }
} }) }