Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3378770
D4190.id13409.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
D4190.id13409.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
@@ -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
Details
Attached
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)
Attached To
Mode
D4190: [lib] Update `threadStore` with `threadStoreOps` for `processServerRequests` action
Attached
Detach File
Event Timeline
Log In to Comment