Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3529695
D9707.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D9707.diff
View Options
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 &&
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 8:43 PM (11 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2703130
Default Alt Text
D9707.diff (3 KB)
Attached To
Mode
D9707: [Flow202][lib][skip-ci] [15/23] Fix Flow issues in lib/reducers
Attached
Detach File
Event Timeline
Log In to Comment