diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts index e44a66554..83dabd3fd 100644 --- a/src/frontend/src/stores/flowStore.ts +++ b/src/frontend/src/stores/flowStore.ts @@ -416,6 +416,7 @@ const useFlowStore = create((set, get) => ({ useFlowStore.getState().updateBuildStatus(idList, BuildStatus.BUILDING); }, }); + get().revertBuiltStatusFromBuilding(); }, getFlow: () => { return { @@ -445,6 +446,14 @@ const useFlowStore = create((set, get) => ({ } }); }, + revertBuiltStatusFromBuilding: () => { + get().nodes.forEach((node) => { + if (node.data.buildStatus === BuildStatus.BUILDING) { + node.data.buildStatus = BuildStatus.TO_BUILD; + } + }); + set({ nodes: get().nodes }); + }, })); export default useFlowStore; diff --git a/src/frontend/src/types/zustand/flow/index.ts b/src/frontend/src/types/zustand/flow/index.ts index feaff49f5..2b4e8f251 100644 --- a/src/frontend/src/types/zustand/flow/index.ts +++ b/src/frontend/src/types/zustand/flow/index.ts @@ -90,4 +90,5 @@ export type FlowStoreType = { removeFromVerticesBuild: (vertices: string[]) => void; verticesBuild: string[]; updateBuildStatus: (nodeId: string[], status: BuildStatus) => void; + revertBuiltStatusFromBuilding: () => void; };