fix: keeping path when changing workspace
This commit is contained in:
@@ -19,7 +19,9 @@ 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}`);
|
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 {
|
function findSelectedWorkspace(): Pick<Workspace, 'id'> | null {
|
||||||
|
|||||||
Reference in New Issue
Block a user