From 7c682c5c56bf623e6feafa9c398d9e9b0b2f5059 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Thu, 2 Mar 2023 18:28:58 -0300 Subject: [PATCH] fixed bug --- langflow/frontend/src/components/chatComponent/index.tsx | 4 ++-- langflow/frontend/src/pages/FlowPage/index.tsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/langflow/frontend/src/components/chatComponent/index.tsx b/langflow/frontend/src/components/chatComponent/index.tsx index 51c5c28ac..6c68f2112 100644 --- a/langflow/frontend/src/components/chatComponent/index.tsx +++ b/langflow/frontend/src/components/chatComponent/index.tsx @@ -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'}); diff --git a/langflow/frontend/src/pages/FlowPage/index.tsx b/langflow/frontend/src/pages/FlowPage/index.tsx index 3e7100e5b..69820ff3b 100644 --- a/langflow/frontend/src/pages/FlowPage/index.tsx +++ b/langflow/frontend/src/pages/FlowPage/index.tsx @@ -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) {