fix: keeping path when changing workspace
This commit is contained in:
parent
fff9eb8427
commit
0162c8acf0
|
@ -19,7 +19,9 @@ 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}`);
|
||||
router.push(`/${workspaces.find((w) => w.id === workspace.id)?.slug}/${pathname.split('/')[2]}`);
|
||||
|
||||
// router.push(`/${workspaces.find((w) => w.id === workspace.id)?.slug}`);
|
||||
}
|
||||
|
||||
function findSelectedWorkspace(): Pick<Workspace, 'id'> | null {
|
||||
|
|
Loading…
Reference in New Issue