Refactor onBuildComplete in flowStore.ts to include allNodesValid parameter

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-30 17:51:55 -03:00
commit 70135e7353

View file

@ -529,9 +529,9 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
onGetOrderSuccess: () => {
setNoticeData({ title: "Running components" });
},
onBuildComplete: () => {
onBuildComplete: (allNodesValid) => {
const nodeId = startNodeId || stopNodeId;
if (nodeId) {
if (nodeId && allNodesValid) {
setSuccessData({
title: `${
get().nodes.find((node) => node.id === nodeId)?.data.node