From 93ec12beb7bb91a88e60863734c6f54a576b6d10 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 29 Nov 2023 16:47:38 -0300 Subject: [PATCH] fix(promptComponent): remove unused useEffect hook that was causing unnecessary API calls and re-rendering --- .../src/components/promptComponent/index.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/frontend/src/components/promptComponent/index.tsx b/src/frontend/src/components/promptComponent/index.tsx index d136b2d8d..f5878af12 100644 --- a/src/frontend/src/components/promptComponent/index.tsx +++ b/src/frontend/src/components/promptComponent/index.tsx @@ -1,7 +1,6 @@ import { useEffect } from "react"; import { TypeModal } from "../../constants/enums"; -import { postValidatePrompt } from "../../controllers/API"; import GenericModal from "../../modals/genericModal"; import { PromptAreaComponentType } from "../../types/components"; import IconComponent from "../genericIconComponent"; @@ -23,18 +22,6 @@ export default function PromptAreaComponent({ } }, [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 (