From 855fa46a0e232213921a6266c1f51857345b7c02 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 17 Apr 2026 16:13:46 +0000 Subject: [PATCH] refactor: simplify forgetMissingWorkspace now that removeWorkspace handles switch removeWorkspace already switches to the next available workspace (or falls back to setup). forgetMissingWorkspace can just delegate, dropping the duplicate branch that previously never ran anyway because current_workspace was always null after removal. --- apps/tauri/src/lib/stores/app.svelte.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/apps/tauri/src/lib/stores/app.svelte.ts b/apps/tauri/src/lib/stores/app.svelte.ts index 18f17e5..2b57daa 100644 --- a/apps/tauri/src/lib/stores/app.svelte.ts +++ b/apps/tauri/src/lib/stores/app.svelte.ts @@ -525,22 +525,10 @@ async function addGoogleTasksWorkspace( async function forgetMissingWorkspace() { if (!missingWorkspace) return; + // removeWorkspace handles switching to the next available workspace (or + // falling back to the setup screen when none remain); just delegate. await removeWorkspace(missingWorkspace); missingWorkspace = null; - config = await invoke("get_config"); - if (hasWorkspace) { - // Switch to the next available workspace - const nextName = Object.keys(config!.workspaces)[0]; - if (nextName) { - await switchWorkspace(nextName); - screen = "tasks"; - return; - } - } - screen = "setup"; - lists = []; - tasks = []; - activeListId = null; } function setScreen(s: Screen) {