Page MenuHomePhabricator

D7418.id25352.diff
No OneTemporary

D7418.id25352.diff

diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js
--- a/lib/reducers/message-reducer.js
+++ b/lib/reducers/message-reducer.js
@@ -1236,25 +1236,41 @@
(localInfo: LocalMessageInfo, key: string) => key !== payload.localID,
)(messageStore.local);
+ const updatedThreads = {
+ [threadID]: {
+ ...messageStore.threads[threadID],
+ messageIDs: newMessageIDs,
+ },
+ };
+ messageStoreOperations.push({
+ type: 'replace_threads',
+ payload: { threads: updatedThreads },
+ });
+
const processedMessageStore = processMessageStoreOperations(
messageStore,
messageStoreOperations,
);
+ const newMessageStore = {
+ ...messageStore,
+ messages: processedMessageStore.messages,
+ threads: {
+ ...messageStore.threads,
+ ...updatedThreads,
+ },
+ local,
+ };
+
+ assertMessageStoreThreadsAreEqual(
+ processedMessageStore,
+ newMessageStore,
+ action.type,
+ );
+
return {
messageStoreOperations,
- messageStore: {
- ...messageStore,
- messages: processedMessageStore.messages,
- threads: {
- ...messageStore.threads,
- [threadID]: {
- ...messageStore.threads[threadID],
- messageIDs: newMessageIDs,
- },
- },
- local,
- },
+ messageStore: newMessageStore,
};
} else if (action.type === saveMessagesActionType) {
const truncationStatuses = {};

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 7:37 PM (18 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2688874
Default Alt Text
D7418.id25352.diff (1 KB)

Event Timeline