Prebuild lookup structures to reduce UI lag on very large file lists.

This commit is contained in:
2026-02-04 00:18:28 +00:00
parent 0bc2a12cfa
commit 1af6cd82fe
4 changed files with 21 additions and 4 deletions
+1 -2
View File
@@ -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.) */