diff --git a/space_flow/src/components/chatComponent/index.tsx b/space_flow/src/components/chatComponent/index.tsx index 32acc5699..446bf9b61 100644 --- a/space_flow/src/components/chatComponent/index.tsx +++ b/space_flow/src/components/chatComponent/index.tsx @@ -34,7 +34,7 @@ export default function Chat({ reactFlowInstance }) { return true; } function validateChatNodes(){ - if(!reactFlowInstance.getNodes().some((n)=> (n.type === 'chatOutputNode')) || !reactFlowInstance.getNodes().some((n)=> (n.type === 'chatInputNode'))){ + if(!reactFlowInstance.getNodes().some((n)=> (n.type === 'chatOutputNode'))){ return false; } return true; diff --git a/space_flow/src/pages/FlowPage/index.tsx b/space_flow/src/pages/FlowPage/index.tsx index cbab1f045..61abd40d5 100644 --- a/space_flow/src/pages/FlowPage/index.tsx +++ b/space_flow/src/pages/FlowPage/index.tsx @@ -52,6 +52,7 @@ export default function FlowPage({ flow }) { const [edges, setEdges, onEdgesChange] = useEdgesState( flow.data?.edges ?? [] ); + const {setViewport} = useReactFlow() useEffect(() => { if (reactFlowInstance && flow) { @@ -64,7 +65,7 @@ export default function FlowPage({ flow }) { setNodes(flow?.data?.nodes ?? []); setEdges(flow?.data?.edges ?? []); if (reactFlowInstance) { - reactFlowInstance.setViewport( + setViewport( flow?.data?.viewport ?? { x: 1, y: 0, zoom: 1 } ); }