Delete clearnodes and change nodeEditorReset

This commit is contained in:
mickr777 2023-07-13 19:37:56 +10:00 committed by psychedelicious
parent ee253ea4f1
commit b5e7384f09

View File

@ -121,8 +121,9 @@ const nodesSlice = createSlice({
) => {
state.invocationTemplates = action.payload;
},
nodeEditorReset: () => {
return { ...initialNodesState };
nodeEditorReset: (state) => {
state.nodes = [];
state.edges = [];
},
setEditorInstance: (state, action) => {
state.editorInstance = action.payload;
@ -133,10 +134,6 @@ const nodesSlice = createSlice({
loadFileEdges: (state, action: PayloadAction<Edge[]>) => {
state.edges = action.payload;
},
clearNodes: (state) => {
state.nodes = [];
state.edges = [];
},
},
extraReducers: (builder) => {
builder.addCase(receivedOpenAPISchema.fulfilled, (state, action) => {