fix: rerouting when workspace change with undefined
This commit is contained in:
parent
0162c8acf0
commit
8f47633e86
|
@ -19,7 +19,7 @@ export default function WorkspaceNavigation({ workspaces }: { workspaces: Pick<W
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
function onWorkspaceSelectionChange(workspace: Pick<Workspace, 'id'>) {
|
function onWorkspaceSelectionChange(workspace: Pick<Workspace, 'id'>) {
|
||||||
router.push(`/${workspaces.find((w) => w.id === workspace.id)?.slug}/${pathname.split('/')[2]}`);
|
router.push(`/${workspaces.find((w) => w.id === workspace.id)?.slug}/${pathname.split('/')[2] || ''}`);
|
||||||
|
|
||||||
// router.push(`/${workspaces.find((w) => w.id === workspace.id)?.slug}`);
|
// router.push(`/${workspaces.find((w) => w.id === workspace.id)?.slug}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue