more useeffect dependencies fixed
This commit is contained in:
parent
2be08ff3e5
commit
bc0cb9685c
2 changed files with 26 additions and 27 deletions
|
|
@ -30,7 +30,7 @@ export default function Chat({flow, reactFlowInstance }:ChatType) {
|
||||||
};
|
};
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
updateFlow({..._.cloneDeep(flow),chat:chatHistory})
|
updateFlow({..._.cloneDeep(flow),chat:chatHistory})
|
||||||
},[saveChat])
|
},[chatHistory, flow, saveChat, updateFlow])
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
setChatHistory(flow.chat)
|
setChatHistory(flow.chat)
|
||||||
},[flow])
|
},[flow])
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ export default function ExtraSidebar() {
|
||||||
const [data, setData] = useState({});
|
const [data, setData] = useState({});
|
||||||
const { setTypes} = useContext(typesContext);
|
const { setTypes} = useContext(typesContext);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
async function getTypes():Promise<void>{
|
async function getTypes():Promise<void>{
|
||||||
const initialValue:{[char: string]: string} = {
|
const initialValue:{[char: string]: string} = {
|
||||||
str: "advanced",
|
str: "advanced",
|
||||||
|
|
@ -38,10 +39,8 @@ export default function ExtraSidebar() {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
getTypes();
|
getTypes();
|
||||||
}, []);
|
}, [setTypes]);
|
||||||
|
|
||||||
|
|
||||||
function onDragStart(event: React.DragEvent<any>, data:{type:string,node?:APIClassType}) {
|
function onDragStart(event: React.DragEvent<any>, data:{type:string,node?:APIClassType}) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue