Page MenuHomePhabricator

D4190.id13409.diff
No OneTemporary

D4190.id13409.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
@@ -352,11 +352,9 @@
};
}
- const newThreadInfos = { ...state.threadInfos };
const threadStoreOperations: ThreadStoreOperation[] = [];
if (rawThreadInfos) {
for (const rawThreadInfo of rawThreadInfos) {
- newThreadInfos[rawThreadInfo.id] = rawThreadInfo;
threadStoreOperations.push({
type: 'replace',
payload: {
@@ -367,9 +365,6 @@
}
}
if (deleteThreadIDs) {
- for (const deleteThreadID of deleteThreadIDs) {
- delete newThreadInfos[deleteThreadID];
- }
threadStoreOperations.push({
type: 'remove',
payload: {
@@ -378,21 +373,19 @@
});
}
+ const updatedThreadStore = processThreadStoreOperations(
+ state,
+ threadStoreOperations,
+ );
+
const newThreadInconsistencies = findInconsistencies(
action,
state.threadInfos,
- newThreadInfos,
- );
- const updatedStore = {
- threadInfos: newThreadInfos,
- };
- const processedStore = processThreadStoreOperations(
- state,
- threadStoreOperations,
+ updatedThreadStore.threadInfos,
);
- assertThreadStoreThreadsAreEqual(processedStore, updatedStore, action.type);
+
return {
- threadStore: updatedStore,
+ threadStore: updatedThreadStore,
newThreadInconsistencies,
threadStoreOperations,
};

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 12:57 PM (20 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2594045
Default Alt Text
D4190.id13409.diff (1 KB)

Event Timeline