fix(web): navigate to /issues when switching workspaces

When switching workspaces while on a detail page (e.g. /issues/[id]),
the store clears old data and the page tries to fetch the old resource
with the new workspace context, causing a 404 error. Navigate to the
issues list before switching to avoid referencing stale resources.
This commit is contained in:
Jiayuan 2026-04-02 00:15:47 +08:00
parent e68091e4a8
commit b1f7364097
2 changed files with 4 additions and 0 deletions

View file

@ -132,6 +132,7 @@ export function AppSidebar() {
key={ws.id}
onClick={() => {
if (ws.id !== workspace?.id) {
router.push("/issues");
switchWorkspace(ws.id);
}
}}