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:
parent
e68091e4a8
commit
b1f7364097
2 changed files with 4 additions and 0 deletions
|
|
@ -132,6 +132,7 @@ export function AppSidebar() {
|
|||
key={ws.id}
|
||||
onClick={() => {
|
||||
if (ws.id !== workspace?.id) {
|
||||
router.push("/issues");
|
||||
switchWorkspace(ws.id);
|
||||
}
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue