diff --git a/apps/tauri/src/lib/stores/app.svelte.ts b/apps/tauri/src/lib/stores/app.svelte.ts index 10031b6..18f17e5 100644 --- a/apps/tauri/src/lib/stores/app.svelte.ts +++ b/apps/tauri/src/lib/stores/app.svelte.ts @@ -184,11 +184,17 @@ async function removeWorkspace(id: string) { try { await invoke("remove_workspace", { id }); config = await invoke("get_config"); - if (!hasWorkspace) { + activeListId = null; + tasks = []; + lists = []; + // Switch to the next available workspace rather than dumping the user + // to the setup screen when they still have other workspaces. + const remaining = Object.keys(config?.workspaces ?? {}); + if (remaining.length > 0) { + await switchWorkspace(remaining[0]); + screen = "tasks"; + } else { screen = "setup"; - lists = []; - tasks = []; - activeListId = null; } } catch (e) { error = String(e);