@@ -14,7 +14,6 @@ import {
1414import "@xyflow/react/dist/style.css" ;
1515import { SocketIOProvider } from "y-socket.io" ;
1616import { useQueryClient } from "@tanstack/react-query" ;
17- import { useParams } from "@tanstack/react-router" ;
1817
1918import { usePages } from "@/features/pageSidebar/api/usePages" ;
2019import useYDocStore from "@/shared/model/ydocStore" ;
@@ -35,15 +34,13 @@ export const useCanvas = () => {
3534 const { zoom } = useViewport ( ) ;
3635 const [ nodes , setNodes , onNodesChange ] = useNodesState < Node > ( [ ] ) ;
3736 const [ edges , setEdges , onEdgesChange ] = useEdgesState < Edge > ( [ ] ) ;
38- const { workspaceId } = useParams ( { strict : false } ) ;
39- const { pages } = usePages ( workspaceId ?? "main" ) ;
37+ const workspace = useWorkspace ( ) ;
38+ const { pages } = usePages ( workspace ) ;
4039
4140 const queryClient = useQueryClient ( ) ;
4241 const { ydoc } = useYDocStore ( ) ;
4342 const { getIntersectingNodes } = useReactFlow ( ) ;
4443
45- const workspace = useWorkspace ( ) ;
46-
4744 const { cursors, handleMouseMove, handleNodeDrag, handleMouseLeave } =
4845 useCollaborativeCursors ( {
4946 ydoc,
0 commit comments