diff --git a/src/store/actions.ts b/src/store/actions.ts index 2f965b4..aebd506 100644 --- a/src/store/actions.ts +++ b/src/store/actions.ts @@ -169,7 +169,7 @@ export const performSync = createAction( export const appendError = createAction( "APPEND_ERROR", (error: Error | Error[]) => { - return Array.isArray(error) ? error : [error]; + return error; } ); diff --git a/src/store/reducers.ts b/src/store/reducers.ts index 7eb2ec3..2287e0c 100644 --- a/src/store/reducers.ts +++ b/src/store/reducers.ts @@ -215,7 +215,11 @@ export const errorsReducer = handleActions( return state; }, [actions.appendError.toString()]: (state: List, action: Action) => { - return state.push(...action.payload); + if (Array.isArray(action.payload)) { + return state.push(...action.payload); + } else { + return state.push(action.payload); + } }, [actions.clearErros.toString()]: (state: List, _action: Action) => { return state.clear();