Refactor to make full file list completely non-reactive because pinia persistence was causing long delays especially while searching when there were a lot of files. Implement better ghosts that do not alter the file list.

This commit is contained in:
2026-02-04 02:03:22 +00:00
parent 1af6cd82fe
commit 8270dd0cc2
10 changed files with 178 additions and 51 deletions
+5 -1
View File
@@ -1,9 +1,13 @@
import { useMainStore } from '@/stores/main'
import { getDocuments } from '@/stores/documentStore'
export const exists = (path: string[]) => {
const store = useMainStore()
return store.pathSet.has(path.join('/'))
// Access docVersion to make this reactive
void store.docVersion
const p = path.join('/')
return getDocuments().some(doc => (doc.loc ? `${doc.loc}/${doc.name}` : doc.name) === p)
}
/** Strip file extension intelligently (handles .tar.gz, name.with.dots.pdf, etc.) */