diff options
| author | Adam Malczewski <[email protected]> | 2026-10-19 13:38:57 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-10-19 13:38:57 +0900 |
| commit | c4397f633415a46852f0e3b49c78ab7b2d87d4c1 (patch) | |
| tree | 047a5687565059422cbb38aeda8988502a66b78d /src/features/workspaces/ui/WorkspacesHome.svelte | |
| parent | f6d96289470ac888670050ff64c54bbe69b973cb (diff) | |
| download | dispatch-web-c4397f633415a46852f0e3b49c78ab7b2d87d4c1.tar.gz dispatch-web-c4397f633415a46852f0e3b49c78ab7b2d87d4c1.zip | |
feat(workspaces): block creating a workspace whose slug is archived
Diffstat (limited to 'src/features/workspaces/ui/WorkspacesHome.svelte')
| -rw-r--r-- | src/features/workspaces/ui/WorkspacesHome.svelte | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/features/workspaces/ui/WorkspacesHome.svelte b/src/features/workspaces/ui/WorkspacesHome.svelte index 630c67f..65e1593 100644 --- a/src/features/workspaces/ui/WorkspacesHome.svelte +++ b/src/features/workspaces/ui/WorkspacesHome.svelte @@ -215,12 +215,13 @@ if (result.ok) deselect(); } - // ── Create (header popover): create on the backend — do NOT navigate — - // place the new tile in the first empty slot, and go straight into rename. + // ── Create (header popover): check the slug resolves to no archived + // workspace, create on the backend — do NOT navigate — place the new tile in + // the first empty slot, and go straight into rename. async function createWorkspace( slug: string, ): Promise<{ ok: true } | { ok: false; error: string }> { - const result = await store.ensure(slug); + const result = await store.create(slug); if (!result.ok) return { ok: false, error: result.error }; await store.refresh(); // Idempotent: if the list refresh's sync already appended the id, this |
