flow tabs bug solved with variable control inside chat]
This commit is contained in:
parent
571733e261
commit
682190dec0
1 changed files with 5 additions and 2 deletions
|
|
@ -15,6 +15,7 @@ const _ = require("lodash");
|
||||||
|
|
||||||
export default function Chat({flow, reactFlowInstance }) {
|
export default function Chat({flow, reactFlowInstance }) {
|
||||||
const {updateFlow} = useContext(TabsContext)
|
const {updateFlow} = useContext(TabsContext)
|
||||||
|
const [saveChat,setSaveChat] = useState(false)
|
||||||
const [open, setOpen] = useState(true);
|
const [open, setOpen] = useState(true);
|
||||||
const [chatValue, setChatValue] = useState("");
|
const [chatValue, setChatValue] = useState("");
|
||||||
const [chatHistory, setChatHistory] = useState(flow.chat);
|
const [chatHistory, setChatHistory] = useState(flow.chat);
|
||||||
|
|
@ -25,14 +26,16 @@ export default function Chat({flow, reactFlowInstance }) {
|
||||||
newChat.push({ message, isSend });
|
newChat.push({ message, isSend });
|
||||||
return newChat;
|
return newChat;
|
||||||
});
|
});
|
||||||
|
setSaveChat(chat=>!chat)
|
||||||
};
|
};
|
||||||
//bug here why??
|
//bug here why??
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
|
console.log("flow")
|
||||||
updateFlow({..._.cloneDeep(flow),chat:chatHistory})
|
updateFlow({..._.cloneDeep(flow),chat:chatHistory})
|
||||||
},[chatHistory])
|
},[saveChat])
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
setChatHistory(flow.chat)
|
setChatHistory(flow.chat)
|
||||||
console.log(flow.chat)
|
// console.log(flow.chat)
|
||||||
},[flow])
|
},[flow])
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(ref.current)
|
if(ref.current)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue