Files
paseo/packages/app/src/hooks/use-workspace-navigation.ts
T
Mohamed BoudraandGitHub 868479c493 Fix workspace navigation regression on web (#772)
Centralize workspace navigation behind a small route-derived API so the workspace shell reads active selection from the current Expo Router route instead of a separately synchronized store.

Remove the stale layout-driven active-workspace write that regressed web after 02e5b564.
2026-05-06 13:22:31 +08:00

20 lines
476 B
TypeScript

import { useCallback } from "react";
import { navigateToWorkspace } from "@/stores/navigation-active-workspace-store";
export { navigateToWorkspace };
export function useWorkspaceNavigation() {
return {
navigateToWorkspace: useCallback(
(
serverId: string,
workspaceId: string,
options?: Parameters<typeof navigateToWorkspace>[2],
) => {
navigateToWorkspace(serverId, workspaceId, options);
},
[],
),
};
}