diff --git a/src/frontend/src/components/IOview/index.tsx b/src/frontend/src/components/IOview/index.tsx index 6f836fe41..8f914c716 100644 --- a/src/frontend/src/components/IOview/index.tsx +++ b/src/frontend/src/components/IOview/index.tsx @@ -50,36 +50,19 @@ export default function IOView({ children, open, setOpen }): JSX.Element { const [chatValue, setChatValue] = useState(""); const isBuilding = useFlowStore((state) => state.isBuilding); const currentFlow = useFlowsManagerStore((state) => state.currentFlow); - const verticesBuild = useFlowStore((state) => state.verticesBuild); - const updateVerticesBuild = useFlowStore( - (state) => state.updateVerticesBuild - ); async function updateVertices() { - return new Promise((resolve, reject) => { - if (!verticesBuild) { - updateVerticesOrder(currentFlow!.id, null).then((orderResponse) => { - resolve(); - }); - } - resolve(); - }); + return updateVerticesOrder(currentFlow!.id, null); } - useEffect(() => { - updateVertices(); - }, [currentFlow]); - useEffect(() => { if (open) { - updateVerticesBuild(null); updateVertices(); } - }, [open]); + }, [open, currentFlow]); async function sendMessage(count = 1): Promise { if (isBuilding) return; - await updateVertices(); setIsBuilding(true); setLockChat(true); setChatValue("");