fixed bug

This commit is contained in:
Lucas Oliveira 2023-03-02 18:28:58 -03:00
commit 7c682c5c56
2 changed files with 4 additions and 3 deletions

View file

@ -31,10 +31,10 @@ export default function Chat({flow, reactFlowInstance }:ChatType) {
useEffect(()=>{
updateFlow({..._.cloneDeep(flow),chat:chatHistory})
// eslint-disable-next-line react-hooks/exhaustive-deps
},[chatHistory, flow])
},[saveChat])
useEffect(()=>{
setChatHistory(flow.chat)
},[flow.chat])
},[flow])
useEffect(()=>{
if(ref.current)
ref.current.scrollIntoView({behavior: 'smooth'});

View file

@ -63,9 +63,10 @@ export default function FlowPage({ flow }:{flow:FlowType}) {
updateFlow(flow);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [nodes, edges, reactFlowInstance, flow]);
}, [nodes, edges]);
useEffect(() => {
console.log('oi')
setNodes(flow?.data?.nodes ?? []);
setEdges(flow?.data?.edges ?? []);
if (reactFlowInstance) {