diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index 4081b7b33..6662a0781 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -21,6 +21,7 @@ import { downloadFlowsFromDatabase, uploadFlowsToDatabase, } from "../controllers/API"; +import _ from "lodash"; const uid = new ShortUniqueId({ length: 5 }); diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx index 18aca8fe3..c27e8d64e 100644 --- a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx @@ -127,6 +127,7 @@ export default function Page({ flow }: { flow: FlowType }) { setEdges(flow?.data?.edges ?? []); if (reactFlowInstance) { setViewport(flow?.data?.viewport ?? { x: 1, y: 0, zoom: 0.5 }); + reactFlowInstance.fitView(); } }, [flow, reactFlowInstance, setEdges, setNodes, setViewport]); //set extra sidebar