perf(app): faster workspace creation

This commit is contained in:
Adam
2026-01-22 22:09:18 -06:00
parent 3fbda54045
commit c4d223eb99
6 changed files with 328 additions and 43 deletions

View File

@@ -338,6 +338,22 @@ export namespace Project {
return valid
}
export async function addSandbox(projectID: string, directory: string) {
const result = await Storage.update<Info>(["project", projectID], (draft) => {
const sandboxes = draft.sandboxes ?? []
if (!sandboxes.includes(directory)) sandboxes.push(directory)
draft.sandboxes = sandboxes
draft.time.updated = Date.now()
})
GlobalBus.emit("event", {
payload: {
type: Event.Updated.type,
properties: result,
},
})
return result
}
export async function removeSandbox(projectID: string, directory: string) {
const result = await Storage.update<Info>(["project", projectID], (draft) => {
const sandboxes = draft.sandboxes ?? []