Fix root hashing due to missing root dirs

This commit is contained in:
Misode
2024-11-21 01:30:42 +01:00
parent 4bc6e758da
commit 5cfd17a107
4 changed files with 9 additions and 6 deletions

View File

@@ -33,9 +33,10 @@ export function ProjectCreation() {
}
}
const onCreate = useCallback(() => {
const onCreate = useCallback(async () => {
setCreating(true)
const rootUri = `${PROJECTS_URI}${hexId()}/`
await client.fs.mkdir(rootUri)
createProject({ name, namespace, version, storage: { type: 'indexeddb', rootUri } })
changeProject(name)
if (file) {

View File

@@ -32,7 +32,7 @@ export function ProjectPanel() {
}
service.watchTree(projectRoot, setEntries)
client.fs.readdir(projectRoot).then(entries => {
setEntries(entries.flatMap(e => e.name.startsWith(projectRoot) ? [e.name.slice(projectRoot.length)] : []))
setEntries(entries.flatMap(e => e.isFile() && e.name.startsWith(projectRoot) ? [e.name.slice(projectRoot.length)] : []))
})
return () => service.unwatchTree(projectRoot, setEntries)
}, [service, projectRoot])