diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 877a179fc..f95849dd7 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -465,7 +465,7 @@ export default function GenericNode({ variant="outline" className={"h-9 px-1.5"} onClick={() => { - if(data?.build_status === BuildStatus.BUILDING) return; + if(data?.build_status === BuildStatus.BUILDING || isBuilding) return; buildFlow(data.id) }} > diff --git a/src/frontend/src/components/newChatView/index.tsx b/src/frontend/src/components/newChatView/index.tsx index 2831a5c9c..bcb167714 100644 --- a/src/frontend/src/components/newChatView/index.tsx +++ b/src/frontend/src/components/newChatView/index.tsx @@ -35,6 +35,7 @@ export default function newChatView(): JSX.Element { const setIsBuilding = useFlowStore((state) => state.setIsBuilding); const [lockChat, setLockChat] = useState(false); const messagesRef = useRef(null); + const isBuilding = useFlowStore((state) => state.isBuilding); const inputTypes = inputs.map((obj) => obj.type); const inputIds = inputs.map((obj) => obj.id); @@ -105,6 +106,7 @@ export default function newChatView(): JSX.Element { }, []); async function sendMessage(count = 1): Promise { + if(isBuilding) return; const { nodes, edges } = getFlow(); let nodeValidationErrors = validateNodes(nodes, edges); if (nodeValidationErrors.length === 0) {