Page MenuHomePhabricator

D9707.id32711.diff
No OneTemporary

D9707.id32711.diff

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
@@ -78,13 +78,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 &&

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 26, 8:38 AM (12 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2704637
Default Alt Text
D9707.id32711.diff (3 KB)

Event Timeline