From 8f5c224283116e56574ef76d131d343b4d649a7e Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 17 Jun 2024 11:15:03 -0300 Subject: [PATCH] Refactor flowStore.ts to improve build success alert logic --- src/frontend/src/stores/flowStore.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts index 6d1c2ad5c..15c5cf590 100644 --- a/src/frontend/src/stores/flowStore.ts +++ b/src/frontend/src/stores/flowStore.ts @@ -542,15 +542,13 @@ const useFlowStore = create((set, get) => ({ onBuildComplete: (allNodesValid) => { const nodeId = startNodeId || stopNodeId; if (!silent) { - if (nodeId && allNodesValid) { + if (allNodesValid) { setSuccessData({ - title: `${ + title: nodeId?`${ get().nodes.find((node) => node.id === nodeId)?.data.node ?.display_name - } built successfully`, + } built successfully`:FLOW_BUILD_SUCCESS_ALERT, }); - } else { - setSuccessData({ title: FLOW_BUILD_SUCCESS_ALERT }); } } get().setIsBuilding(false);