Prebuild lookup structures to reduce UI lag on very large file lists.
This commit is contained in:
@@ -3,8 +3,7 @@ import { useMainStore } from '@/stores/main'
|
||||
|
||||
export const exists = (path: string[]) => {
|
||||
const store = useMainStore()
|
||||
const p = path.join('/')
|
||||
return store.document.some(doc => (doc.loc ? `${doc.loc}/${doc.name}` : doc.name) === p)
|
||||
return store.pathSet.has(path.join('/'))
|
||||
}
|
||||
|
||||
/** Strip file extension intelligently (handles .tar.gz, name.with.dots.pdf, etc.) */
|
||||
|
||||
Reference in New Issue
Block a user