Delete files when deleting a project

This commit is contained in:
Misode
2024-11-20 04:37:11 +01:00
parent e11e88d6db
commit 22e787bf4e
3 changed files with 19 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ import { useSpyglass } from '../../contexts/Spyglass.jsx'
import type { VersionId } from '../../services/index.js'
import { DEFAULT_VERSION } from '../../services/index.js'
import { PROJECTS_URI } from '../../services/Spyglass.js'
import { hexId, readZip } from '../../Utils.js'
import { hexId, message, readZip } from '../../Utils.js'
import { Btn, BtnMenu, FileUpload, Octicon, TextInput } from '../index.js'
import { Modal } from '../Modal.js'
@@ -45,8 +45,9 @@ export function ProjectCreation() {
return client.fs.writeFile(rootUri + path, entry[1])
}))
hideModal()
}).catch(() => {
}).catch((e) => {
// TODO: handle errors
console.warn(`Error importing data pack: ${message(e)}`)
hideModal()
})
} else {