diff --git a/space_flow/src/components/chatComponent/index.tsx b/space_flow/src/components/chatComponent/index.tsx index f5e09213a..32acc5699 100644 --- a/space_flow/src/components/chatComponent/index.tsx +++ b/space_flow/src/components/chatComponent/index.tsx @@ -108,11 +108,7 @@ export default function Chat({ reactFlowInstance }) { let message = chatValue; setChatValue(""); addChatHistory(message, true); - sendAll({ - message, - nodes: JSON.stringify(reactFlowInstance.getNodes()), - edges: JSON.stringify(reactFlowInstance.getEdges()), - }).then((r) => {addChatHistory(r.data.messsage, false);}); + sendAll({...reactFlowInstance.toObject(),message}).then((r) => {addChatHistory(r.data.messsage, false);}); } else { setErrorData({title: 'Error sending message', list:['Chat nodes are missing.']}) }