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 -1
View File
@@ -98,7 +98,7 @@ const uploadCloudFiles = (files: CloudFile[]) => {
files.sort((a, b) => collator.compare(a.cloudName, b.cloudName))
// Optimistic update: ghost folders and files
const now = Math.floor(Date.now() / 1000)
const byPath = new Map(store.document.map(d => [d.loc ? `${d.loc}/${d.name}` : d.name, d]))
const byPath = store.docsByPath
const added = new Set<string>()
for (const f of files) {
const lastSlash = f.cloudName.lastIndexOf('/')