🐛 fix(ApiModal/index.tsx): fix bug where tweak.current was not being properly reset when getTweak, tweak.current, and flow["data"]["nodes"] were all empty
✨ feat(ApiModal/index.tsx): add useEffect dependency on flow["data"]["nodes"] to trigger filterNodes function when nodes data changes
This commit is contained in:
parent
e74f3c9dd5
commit
ee4c465aba
1 changed files with 12 additions and 6 deletions
|
|
@ -112,13 +112,19 @@ const ApiModal = forwardRef(
|
|||
];
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
filterNodes();
|
||||
|
||||
if(getTweak.length == 0){
|
||||
const t = buildTweaks(flow);
|
||||
tweak?.current?.push(t);
|
||||
if(getTweak.length == 0 && tweak?.current.length == 0 && flow["data"]["nodes"].length == 0){
|
||||
tweak.current = [];
|
||||
}
|
||||
|
||||
else {
|
||||
tweak.current = [];
|
||||
const t = buildTweaks(flow);
|
||||
tweak.current.push(t);
|
||||
}
|
||||
|
||||
filterNodes();
|
||||
|
||||
if (Object.keys(tweaksCode).length > 0) {
|
||||
tabs.push({
|
||||
name: "Tweaks",
|
||||
|
|
@ -128,7 +134,7 @@ const ApiModal = forwardRef(
|
|||
});
|
||||
}
|
||||
|
||||
}, [closePopUp]);
|
||||
}, [flow["data"]["nodes"]]);
|
||||
|
||||
|
||||
function filterNodes() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue