Rename addError action to fix fetch count.

Fetch count increments/decrements based on all actions prefixed with add
which means addError was also triggering it.
This broke the fetchCount count.
master
Tom Hacohen 4 years ago
parent de07f76c92
commit 06e4e4a5d3

@ -5,7 +5,7 @@ import { List } from 'immutable';
import { EventType, ContactType, TaskType } from './pim-types';
import { store } from './store';
import { addError } from './store/actions';
import { appendError } from './store/actions';
import * as EteSync from 'etesync';
@ -20,7 +20,7 @@ export function syncEntriesToItemMap(
comp = ContactType.parse(syncEntry.content);
} catch (e) {
e.message = `${e.message}\nWhile processing: ${syncEntry.content}`;
store.dispatch(addError(undefined as any, e));
store.dispatch(appendError(undefined as any, e));
return;
}
@ -94,7 +94,7 @@ function syncEntriesToCalendarItemMap<T extends EventType>(
comp = ItemType.parse(syncEntry.content);
} catch (e) {
e.message = `${e.message}\nWhile processing: ${syncEntry.content}`;
store.dispatch(addError(undefined as any, e));
store.dispatch(appendError(undefined as any, e));
return;
}

@ -196,8 +196,8 @@ export function fetchAll(etesync: CredentialsData, currentEntries: EntriesData)
}
export const addError = createAction(
'ADD_ERRORS',
export const appendError = createAction(
'APPEND_ERROR',
(_etesync: CredentialsData, error: Error) => {
return error;
}

@ -258,7 +258,7 @@ export const errorsReducer = handleActions(
return state;
},
[actions.addError.toString()]: (state: List<Error>, action: Action<any>) => {
[actions.appendError.toString()]: (state: List<Error>, action: Action<any>) => {
return state.push(action.payload);
},
[actions.clearErros.toString()]: (state: List<Error>, _action: Action<any>) => {

Loading…
Cancel
Save