fixed bug
This commit is contained in:
parent
f2ff75ab29
commit
7c682c5c56
2 changed files with 4 additions and 3 deletions
|
|
@ -31,10 +31,10 @@ export default function Chat({flow, reactFlowInstance }:ChatType) {
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
updateFlow({..._.cloneDeep(flow),chat:chatHistory})
|
updateFlow({..._.cloneDeep(flow),chat:chatHistory})
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
},[chatHistory, flow])
|
},[saveChat])
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
setChatHistory(flow.chat)
|
setChatHistory(flow.chat)
|
||||||
},[flow.chat])
|
},[flow])
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(ref.current)
|
if(ref.current)
|
||||||
ref.current.scrollIntoView({behavior: 'smooth'});
|
ref.current.scrollIntoView({behavior: 'smooth'});
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,10 @@ export default function FlowPage({ flow }:{flow:FlowType}) {
|
||||||
updateFlow(flow);
|
updateFlow(flow);
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [nodes, edges, reactFlowInstance, flow]);
|
}, [nodes, edges]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
console.log('oi')
|
||||||
setNodes(flow?.data?.nodes ?? []);
|
setNodes(flow?.data?.nodes ?? []);
|
||||||
setEdges(flow?.data?.edges ?? []);
|
setEdges(flow?.data?.edges ?? []);
|
||||||
if (reactFlowInstance) {
|
if (reactFlowInstance) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue