Page MenuHomePhabricator

D4197.id13312.diff
No OneTemporary

D4197.id13312.diff

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
@@ -58,11 +58,7 @@
+updatesResult: { +newUpdates: $ReadOnlyArray<ClientUpdateInfo>, ... },
...
},
-): {
- +threadStoreOperations: $ReadOnlyArray<ThreadStoreOperation>,
- +threadInfos: { +[id: string]: RawThreadInfo },
-} {
- const updatedThreadInfos = { ...threadInfos };
+): $ReadOnlyArray<ThreadStoreOperation> {
let someThreadUpdated = false;
const threadOperations: ThreadStoreOperation[] = [];
for (const update of payload.updatesResult.newUpdates) {
@@ -72,7 +68,6 @@
!_isEqual(threadInfos[update.threadInfo.id])(update.threadInfo)
) {
someThreadUpdated = true;
- updatedThreadInfos[update.threadInfo.id] = update.threadInfo;
threadOperations.push({
type: 'replace',
payload: {
@@ -93,7 +88,6 @@
unread: update.unread,
},
};
- updatedThreadInfos[update.threadID] = updatedThread;
threadOperations.push({
type: 'replace',
payload: {
@@ -106,7 +100,6 @@
threadInfos[update.threadID]
) {
someThreadUpdated = true;
- delete updatedThreadInfos[update.threadID];
threadOperations.push({
type: 'remove',
payload: {
@@ -125,7 +118,6 @@
...threadInfo,
members: newMembers,
};
- updatedThreadInfos[threadID] = updatedThread;
threadOperations.push({
type: 'replace',
payload: {
@@ -138,12 +130,9 @@
}
}
if (!someThreadUpdated) {
- return { threadStoreOperations: [], threadInfos };
+ return [];
}
- return {
- threadStoreOperations: threadOperations,
- threadInfos: updatedThreadInfos,
- };
+ return threadOperations;
}
function findInconsistencies(
@@ -244,7 +233,7 @@
threadStoreOperations: [],
};
}
- const { threadStoreOperations } = reduceThreadUpdates(
+ const threadStoreOperations = reduceThreadUpdates(
state.threadInfos,
action.payload,
);

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 7:44 PM (20 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577160
Default Alt Text
D4197.id13312.diff (2 KB)

Event Timeline