Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3253551
D7419.id25372.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
D7419.id25372.diff
View Options
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
@@ -76,11 +76,11 @@
type ReplaceMessageOperation,
type MessageStoreOperation,
type MessageTruncationStatus,
- type ThreadMessageInfo,
type MessageTruncationStatuses,
messageTruncationStatus,
messageTypes,
defaultNumberPerThread,
+ type ThreadMessageInfo,
} from '../types/message-types.js';
import type { RawImagesMessageInfo } from '../types/messages/images.js';
import type { RawMediaMessageInfo } from '../types/messages/media.js';
@@ -1529,6 +1529,12 @@
type: 'replace',
payload: { id: localID, messageInfo },
},
+ {
+ type: 'replace_threads',
+ payload: {
+ threads: { [threadID]: threadState },
+ },
+ },
];
const processedMessageStore = processMessageStoreOperations(
@@ -1536,16 +1542,24 @@
messageStoreOperations,
);
+ const newMessageStore = {
+ ...messageStore,
+ threads: {
+ ...messageStore.threads,
+ [threadID]: threadState,
+ },
+ messages: processedMessageStore.messages,
+ };
+
+ assertMessageStoreThreadsAreEqual(
+ processedMessageStore,
+ newMessageStore,
+ action.type,
+ );
+
return {
messageStoreOperations,
- messageStore: {
- ...messageStore,
- threads: {
- ...messageStore.threads,
- [threadID]: threadState,
- },
- messages: processedMessageStore.messages,
- },
+ messageStore: newMessageStore,
};
} else if (action.type === processServerRequestsActionType) {
const {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 7:12 PM (20 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2501135
Default Alt Text
D7419.id25372.diff (1 KB)
Attached To
Mode
D7419: [lib] generate message store ops for threads after creating local message
Attached
Detach File
Event Timeline
Log In to Comment