Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3356219
D4190.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.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
Sun, Nov 24, 5:29 PM (21 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2576875
Default Alt Text
D4190.diff (1 KB)
Attached To
Mode
D4190: [lib] Update `threadStore` with `threadStoreOps` for `processServerRequests` action
Attached
Detach File
Event Timeline
Log In to Comment