fix: rerouting when workspace change with undefined
This commit is contained in:
@@ -19,7 +19,7 @@ export default function WorkspaceNavigation({ workspaces }: { workspaces: Pick<W
|
||||
const router = useRouter();
|
||||
|
||||
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}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user