Fix indexeddb file system readdir to use a range

This commit is contained in:
Misode
2024-11-26 18:04:11 +01:00
parent 46ed105c34
commit 6badc9f06f
7 changed files with 20 additions and 19 deletions

View File

@@ -134,12 +134,7 @@ export function ProjectProvider({ children }: { children: ComponentChildren }) {
if (project) {
const projectRoot = getProjectRoot(project)
const entries = await SpyglassClient.FS.readdir(projectRoot)
await Promise.all(entries.flatMap(async e => {
if (e.name.startsWith(projectRoot)) {
return [await SpyglassClient.FS.unlink(e.name)]
}
return []
}))
await Promise.all(entries.map(async e => SpyglassClient.FS.unlink(e.name)))
}
changeProjects(projects.filter(p => p.name !== name))
setOpenProject(undefined)