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.
20 lines
476 B
TypeScript
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);
|
|
},
|
|
[],
|
|
),
|
|
};
|
|
}
|