From 431b8f1bd335287c9906d3c45c064a63847bab1b Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Thu, 23 Feb 2023 18:20:20 -0300 Subject: [PATCH] debug messages --- space_flow/src/components/chatComponent/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/space_flow/src/components/chatComponent/index.tsx b/space_flow/src/components/chatComponent/index.tsx index 57e6e44e1..99bebdd75 100644 --- a/space_flow/src/components/chatComponent/index.tsx +++ b/space_flow/src/components/chatComponent/index.tsx @@ -18,11 +18,13 @@ export default function Chat({ reactFlowInstance }) { const [chatHistory, setChatHistory] = useState([]); const {setErrorData} = useContext(alertContext); const addChatHistory = (message, isSend) => { + console.log(message); setChatHistory((old) => { let newChat = _.cloneDeep(old); newChat.push({ message, isSend }); return newChat; }); + console.log(chatHistory); }; useEffect(()=>{ ref.current.scrollIntoView({behavior: 'smooth'}); @@ -108,7 +110,7 @@ export default function Chat({ reactFlowInstance }) { let message = chatValue; setChatValue(""); addChatHistory(message, true); - sendAll({...reactFlowInstance.toObject(),message}).then((r) => {console.log(r.data.result); addChatHistory(r.data.result, false);}); + sendAll({...reactFlowInstance.toObject(),message}).then((r) => {addChatHistory(r.data.result, false);}); addChatHistory('teste', false); } else { setErrorData({title: 'Error sending message', list:['Chat nodes are missing.']})