diff --git a/lib/reducers/entry-reducer.js b/lib/reducers/entry-reducer.js --- a/lib/reducers/entry-reducer.js +++ b/lib/reducers/entry-reducer.js @@ -418,22 +418,24 @@ }, [], ]; - } else if (action.type === deleteEntryActionTypes.success && action.payload) { + } else if (action.type === deleteEntryActionTypes.success) { const { payload } = action; - const [updatedEntryInfos, updatedDaysToEntries] = mergeNewEntryInfos( - entryInfos, - daysToEntries, - mergeUpdateEntryInfos([], payload.updatesResult.viewerUpdates), - newThreadInfos, - ); - return [ - { - entryInfos: updatedEntryInfos, - daysToEntries: updatedDaysToEntries, - lastUserInteractionCalendar, - }, - [], - ]; + if (payload) { + const [updatedEntryInfos, updatedDaysToEntries] = mergeNewEntryInfos( + entryInfos, + daysToEntries, + mergeUpdateEntryInfos([], payload.updatesResult.viewerUpdates), + newThreadInfos, + ); + return [ + { + entryInfos: updatedEntryInfos, + daysToEntries: updatedDaysToEntries, + lastUserInteractionCalendar, + }, + [], + ]; + } } else if (action.type === fetchRevisionsForEntryActionTypes.success) { const id = action.payload.entryID; if ( diff --git a/lib/reducers/nav-reducer.js b/lib/reducers/nav-reducer.js --- a/lib/reducers/nav-reducer.js +++ b/lib/reducers/nav-reducer.js @@ -26,13 +26,11 @@ ) { const { startDate, endDate } = action.payload.calendarQuery; return { ...state, startDate, endDate }; - } else if ( - action.type === updateCalendarQueryActionTypes.started && - action.payload && - action.payload.calendarQuery - ) { - const { startDate, endDate } = action.payload.calendarQuery; - return { ...state, startDate, endDate }; + } else if (action.type === updateCalendarQueryActionTypes.started) { + if (action.payload && action.payload.calendarQuery) { + const { startDate, endDate } = action.payload.calendarQuery; + return { ...state, startDate, endDate }; + } } else if ( action.type === updateCalendarQueryActionTypes.success && !action.payload.calendarQueryAlreadyUpdated diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js --- a/lib/reducers/user-reducer.js +++ b/lib/reducers/user-reducer.js @@ -91,13 +91,9 @@ const checkStateRequest = action.payload.serverRequests.find( candidate => candidate.type === serverRequestTypes.CHECK_STATE, ); - if ( - checkStateRequest && - checkStateRequest.stateChanges && - checkStateRequest.stateChanges.currentUserInfo && - !_isEqual(checkStateRequest.stateChanges.currentUserInfo)(state) - ) { - return checkStateRequest.stateChanges.currentUserInfo; + const newCurrentUserInfo = checkStateRequest?.stateChanges?.currentUserInfo; + if (newCurrentUserInfo && !_isEqual(newCurrentUserInfo)(state)) { + return newCurrentUserInfo; } } else if ( action.type === updateUserAvatarActionTypes.success &&