diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts index 9935079f2..588a8ae21 100644 --- a/src/frontend/src/stores/flowStore.ts +++ b/src/frontend/src/stores/flowStore.ts @@ -376,6 +376,14 @@ const useFlowStore = create((set, get) => ({ const setErrorData = useAlertStore.getState().setErrorData; const setNoticeData = useAlertStore.getState().setNoticeData; function handleBuildUpdate(data: any) { + const responseData = data.data[data.id]; + // responseData MAY contain inactive_vertices or it + // may be null, so we need to check for it + if (responseData && responseData.inactive_vertices) { + useFlowStore + .getState() + .setInactiveNodes(responseData.inactive_vertices); + } get().addDataToFlowPool(data.data[data.id], data.id); useFlowStore.getState().updateBuildStatus([data.id], BuildStatus.BUILT); } @@ -431,6 +439,10 @@ const useFlowStore = create((set, get) => ({ set({ verticesBuild: vertices }); }, verticesBuild: [], + setInactiveNodes(newState) { + set({ inactiveNodes: newState }); + }, + inactiveNodes: [], })); export default useFlowStore; diff --git a/src/frontend/src/types/zustand/flow/index.ts b/src/frontend/src/types/zustand/flow/index.ts index f0bad1578..461dd5599 100644 --- a/src/frontend/src/types/zustand/flow/index.ts +++ b/src/frontend/src/types/zustand/flow/index.ts @@ -89,4 +89,6 @@ export type FlowStoreType = { updateBuildStatus: (nodeId: string[], status: BuildStatus) => void; updateVerticesBuild: (vertices: string[]) => void; verticesBuild: string[]; + inactiveNodes: string[]; + setInactiveNodes: (newState: string[]) => void; };