fix(app): reactive file tree

This commit is contained in:
adamelmore
2026-01-26 16:46:01 -06:00
parent b07d7cdb71
commit 021d9d105e
4 changed files with 35 additions and 7 deletions

View File

@@ -571,6 +571,18 @@ export const { use: useFile, provider: FileProvider } = createSimpleContext({
}
const kind = event.properties.event
if (kind === "change") {
const dir = (() => {
if (path === "") return ""
const node = tree.node[path]
if (node?.type !== "directory") return
return path
})()
if (dir === undefined) return
if (!tree.dir[dir]?.loaded) return
listDir(dir, { force: true })
return
}
if (kind !== "add" && kind !== "unlink") return
const parent = path.split("/").slice(0, -1).join("/")