Add setInactiveNodes function to FlowStore
This commit is contained in:
parent
baf5ffb13c
commit
bd2767b1a5
2 changed files with 14 additions and 0 deletions
|
|
@ -376,6 +376,14 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
||||||
const setErrorData = useAlertStore.getState().setErrorData;
|
const setErrorData = useAlertStore.getState().setErrorData;
|
||||||
const setNoticeData = useAlertStore.getState().setNoticeData;
|
const setNoticeData = useAlertStore.getState().setNoticeData;
|
||||||
function handleBuildUpdate(data: any) {
|
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);
|
get().addDataToFlowPool(data.data[data.id], data.id);
|
||||||
useFlowStore.getState().updateBuildStatus([data.id], BuildStatus.BUILT);
|
useFlowStore.getState().updateBuildStatus([data.id], BuildStatus.BUILT);
|
||||||
}
|
}
|
||||||
|
|
@ -431,6 +439,10 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
||||||
set({ verticesBuild: vertices });
|
set({ verticesBuild: vertices });
|
||||||
},
|
},
|
||||||
verticesBuild: [],
|
verticesBuild: [],
|
||||||
|
setInactiveNodes(newState) {
|
||||||
|
set({ inactiveNodes: newState });
|
||||||
|
},
|
||||||
|
inactiveNodes: [],
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export default useFlowStore;
|
export default useFlowStore;
|
||||||
|
|
|
||||||
|
|
@ -89,4 +89,6 @@ export type FlowStoreType = {
|
||||||
updateBuildStatus: (nodeId: string[], status: BuildStatus) => void;
|
updateBuildStatus: (nodeId: string[], status: BuildStatus) => void;
|
||||||
updateVerticesBuild: (vertices: string[]) => void;
|
updateVerticesBuild: (vertices: string[]) => void;
|
||||||
verticesBuild: string[];
|
verticesBuild: string[];
|
||||||
|
inactiveNodes: string[];
|
||||||
|
setInactiveNodes: (newState: string[]) => void;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue