chat input validation removed

This commit is contained in:
anovazzi1 2023-02-23 15:49:17 -03:00
commit 912dff60ec
2 changed files with 3 additions and 2 deletions

View file

@ -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;

View file

@ -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 }
);
}