Update nodesSlice.ts

This commit is contained in:
mickr777 2023-07-18 12:11:13 +10:00 committed by GitHub
parent 11882173e3
commit 9dbffadc6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,7 @@ export type NodesState = {
connectionStartParams: OnConnectStartParams | null; connectionStartParams: OnConnectStartParams | null;
shouldShowGraphOverlay: boolean; shouldShowGraphOverlay: boolean;
shouldShowFieldTypeLegend: boolean; shouldShowFieldTypeLegend: boolean;
shouldShowMinimapPanel: boolean;
editorInstance: ReactFlowInstance | undefined; editorInstance: ReactFlowInstance | undefined;
}; };
@ -44,6 +45,7 @@ export const initialNodesState: NodesState = {
connectionStartParams: null, connectionStartParams: null,
shouldShowGraphOverlay: false, shouldShowGraphOverlay: false,
shouldShowFieldTypeLegend: false, shouldShowFieldTypeLegend: false,
shouldShowMinimapPanel: true,
editorInstance: undefined, editorInstance: undefined,
}; };
@ -133,6 +135,9 @@ const nodesSlice = createSlice({
) => { ) => {
state.shouldShowFieldTypeLegend = action.payload; state.shouldShowFieldTypeLegend = action.payload;
}, },
shouldShowMinimapPanelChanged: (state, action: PayloadAction<boolean>) => {
state.shouldShowMinimapPanel = action.payload;
},
nodeTemplatesBuilt: ( nodeTemplatesBuilt: (
state, state,
action: PayloadAction<Record<string, InvocationTemplate>> action: PayloadAction<Record<string, InvocationTemplate>>
@ -170,6 +175,7 @@ export const {
connectionEnded, connectionEnded,
shouldShowGraphOverlayChanged, shouldShowGraphOverlayChanged,
shouldShowFieldTypeLegendChanged, shouldShowFieldTypeLegendChanged,
shouldShowMinimapPanelChanged,
nodeTemplatesBuilt, nodeTemplatesBuilt,
nodeEditorReset, nodeEditorReset,
imageCollectionFieldValueChanged, imageCollectionFieldValueChanged,