Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3392490
D4200.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4200.diff
View Options
diff --git a/lib/reducers/thread-reducer.js b/lib/reducers/thread-reducer.js
--- a/lib/reducers/thread-reducer.js
+++ b/lib/reducers/thread-reducer.js
@@ -219,7 +219,8 @@
action.type === processUpdatesActionType ||
action.type === newThreadActionTypes.success
) {
- if (action.payload.updatesResult.newUpdates.length === 0) {
+ const { newUpdates } = action.payload.updatesResult;
+ if (newUpdates.length === 0) {
return {
threadStore: state,
newThreadInconsistencies: [],
@@ -240,18 +241,19 @@
threadStoreOperations,
};
} else if (action.type === updateSubscriptionActionTypes.success) {
+ const { threadID, subscription } = action.payload;
const newThreadInfo = {
- ...state.threadInfos[action.payload.threadID],
+ ...state.threadInfos[threadID],
currentUser: {
- ...state.threadInfos[action.payload.threadID].currentUser,
- subscription: action.payload.subscription,
+ ...state.threadInfos[threadID].currentUser,
+ subscription,
},
};
const threadStoreOperations = [
{
type: 'replace',
payload: {
- id: action.payload.threadID,
+ id: threadID,
threadInfo: newThreadInfo,
},
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 1, 8:50 AM (20 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2604459
Default Alt Text
D4200.diff (1 KB)
Attached To
Mode
D4200: [lib] Destructure some properties in `reduceThreadInfos` to improve readability
Attached
Detach File
Event Timeline
Log In to Comment