Refactor flowStore.ts to improve build success alert logic
This commit is contained in:
parent
f9de8672aa
commit
8f5c224283
1 changed files with 3 additions and 5 deletions
|
|
@ -542,15 +542,13 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
||||||
onBuildComplete: (allNodesValid) => {
|
onBuildComplete: (allNodesValid) => {
|
||||||
const nodeId = startNodeId || stopNodeId;
|
const nodeId = startNodeId || stopNodeId;
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
if (nodeId && allNodesValid) {
|
if (allNodesValid) {
|
||||||
setSuccessData({
|
setSuccessData({
|
||||||
title: `${
|
title: nodeId?`${
|
||||||
get().nodes.find((node) => node.id === nodeId)?.data.node
|
get().nodes.find((node) => node.id === nodeId)?.data.node
|
||||||
?.display_name
|
?.display_name
|
||||||
} built successfully`,
|
} built successfully`:FLOW_BUILD_SUCCESS_ALERT,
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
setSuccessData({ title: FLOW_BUILD_SUCCESS_ALERT });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get().setIsBuilding(false);
|
get().setIsBuilding(false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue