X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/936aa32e065b7f672e27b95262720c2ce8258bf6..ae946826d1670cb786688e859bc1f3257150ae75:/src/store/dialog/dialog-reducer.ts diff --git a/src/store/dialog/dialog-reducer.ts b/src/store/dialog/dialog-reducer.ts index 775a4d5f..30368685 100644 --- a/src/store/dialog/dialog-reducer.ts +++ b/src/store/dialog/dialog-reducer.ts @@ -11,9 +11,7 @@ export interface Dialog { data: T; } -const initialState: DialogState = {}; - -export const dialogReducer = (state: DialogState = initialState, action: DialogAction) => +export const dialogReducer = (state: DialogState = {}, action: DialogAction) => dialogActions.match(action, { OPEN_DIALOG: ({ id, data }) => ({ ...state, [id]: { open: true, data } }), @@ -21,7 +19,7 @@ export const dialogReducer = (state: DialogState = initialState, action: DialogA ...state, [id]: state[id] ? { ...state[id], open: false } : { open: false, data: {} } }), - CLOSE_ALL_DIALOGS: () => ({ ...initialState }), + CLOSE_ALL_DIALOGS: () => ({ }), default: () => state, });