From ee44f639a384f837c60fe2e7c520ed600a7b70b4 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 23 Jul 2026 14:53:57 +0200 Subject: [PATCH] handle partial grouped project removal Co-authored-by: codex --- apps/web/src/components/SidebarV2.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/SidebarV2.tsx b/apps/web/src/components/SidebarV2.tsx index 3035ebca6f..2078b0ffc4 100644 --- a/apps/web/src/components/SidebarV2.tsx +++ b/apps/web/src/components/SidebarV2.tsx @@ -942,7 +942,7 @@ export default function SidebarV2() { ); const projectRef = scopeProjectRef(project.environmentId, project.id); const projectDraftThread = draftStore.getDraftThreadByProjectRef(projectRef); - shouldNavigate ||= shouldNavigateAfterProjectRemoval({ + const memberRemovalNeedsNavigation = shouldNavigateAfterProjectRemoval({ routeTarget: routeTargetRef.current, projectThreads: memberThreads, projectDraftId: projectDraftThread?.draftId ?? null, @@ -966,9 +966,13 @@ export default function SidebarV2() { }), ); } + if (shouldNavigate) { + void router.navigate({ to: "/" }); + } return; } + shouldNavigate ||= memberRemovalNeedsNavigation; if (projectDraftThread) { draftStore.clearDraftThread(projectDraftThread.draftId); }