diff --git a/src/frontend/src/components/chatComponent/buildTrigger/index.tsx b/src/frontend/src/components/chatComponent/buildTrigger/index.tsx index 66bc0d371..43016ddeb 100644 --- a/src/frontend/src/components/chatComponent/buildTrigger/index.tsx +++ b/src/frontend/src/components/chatComponent/buildTrigger/index.tsx @@ -10,7 +10,7 @@ import { FlowType } from "../../../types/flow"; import { TabsContext } from "../../../contexts/tabsContext"; import { parsedDataType } from "../../../types/components"; import { TabsState } from "../../../types/tabs"; -import { validateNodes } from "../../../utils/reactflowUtils"; +import { processFlow, validateNodes } from "../../../utils/reactflowUtils"; import RadialProgressComponent from "../../RadialProgress"; import IconComponent from "../../genericIconComponent"; @@ -128,7 +128,7 @@ export default function BuildTrigger({ // Step 3: Wait for the stream to finish while (!finished) { await new Promise((resolve) => setTimeout(resolve, 100)); - finished = validationResults.length === flow.data!.nodes.length; + finished = validationResults.length === processFlow(flow.data!).nodes.length; } // Step 4: Return true if all nodes are valid, false otherwise return validationResults.every((result) => result); diff --git a/src/frontend/src/modals/formModal/index.tsx b/src/frontend/src/modals/formModal/index.tsx index 234942f71..53041b149 100644 --- a/src/frontend/src/modals/formModal/index.tsx +++ b/src/frontend/src/modals/formModal/index.tsx @@ -368,7 +368,7 @@ export default function FormModal({ tabsState[flow.id].formKeysData.template ); sendAll({ - ...processFlow(reactFlowInstance?.toObject()!), + ...reactFlowInstance?.toObject()!, inputs: inputs!, chatHistory, name: flow.name, diff --git a/src/frontend/src/utils/reactflowUtils.ts b/src/frontend/src/utils/reactflowUtils.ts index 3c55432a8..70ed7c42d 100644 --- a/src/frontend/src/utils/reactflowUtils.ts +++ b/src/frontend/src/utils/reactflowUtils.ts @@ -921,16 +921,18 @@ export function getGroupStatus( flow: FlowType, ssData: { [key: string]: { valid: boolean; params: string } } ) { - let Nodestatus: Array = []; + let status = { valid: true, params: "Built sucessfully ✨" }; const { nodes } = flow.data!; const ids = nodes.map((n: NodeType) => n.data.id); + ids.forEach((id)=>console.log(ssData[id])) ids.forEach((id) => { if (!ssData[id]) { - return ssData[id]; + status = ssData[id] + return } if (!ssData[id].valid) { - return { valid: false, params: ssData[id].params }; + status = { valid: false, params: ssData[id].params }; } }); - return { valid: true, params: "Built sucessfully ✨" }; + return status; }