fix(promptComponent): remove unused useEffect hook that was causing unnecessary API calls and re-rendering
This commit is contained in:
parent
8cdae5f45f
commit
93ec12beb7
1 changed files with 0 additions and 13 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|
||||||
import { TypeModal } from "../../constants/enums";
|
import { TypeModal } from "../../constants/enums";
|
||||||
import { postValidatePrompt } from "../../controllers/API";
|
|
||||||
import GenericModal from "../../modals/genericModal";
|
import GenericModal from "../../modals/genericModal";
|
||||||
import { PromptAreaComponentType } from "../../types/components";
|
import { PromptAreaComponentType } from "../../types/components";
|
||||||
import IconComponent from "../genericIconComponent";
|
import IconComponent from "../genericIconComponent";
|
||||||
|
|
@ -23,18 +22,6 @@ export default function PromptAreaComponent({
|
||||||
}
|
}
|
||||||
}, [disabled]);
|
}, [disabled]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
//prevent update from prompt template after group node if prompt is wrongly marked as not dynamic
|
|
||||||
if (value !== "" && !editNode && !readonly && !nodeClass?.flow) {
|
|
||||||
postValidatePrompt(field_name!, value, nodeClass!).then((apiReturn) => {
|
|
||||||
if (apiReturn.data) {
|
|
||||||
setNodeClass!(apiReturn.data.frontend_node);
|
|
||||||
// need to update reactFlowInstance to re-render the nodes.
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
||||||
<GenericModal
|
<GenericModal
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue