Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3536780
D10280.id34608.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10280.id34608.diff
View Options
diff --git a/native/redux/redux-setup.js b/native/redux/redux-setup.js
--- a/native/redux/redux-setup.js
+++ b/native/redux/redux-setup.js
@@ -315,33 +315,65 @@
return { state, threadStoreOperations: [] };
}
- const updatedActiveThreadInfo = {
- ...state.threadStore.threadInfos[activeThread],
- currentUser: {
- ...state.threadStore.threadInfos[activeThread].currentUser,
- unread: false,
- },
- };
-
- const threadStoreOperations = [
- {
- type: 'replace',
- payload: {
- id: activeThread,
- threadInfo: updatedActiveThreadInfo,
+ const activeThreadInfo = state.threadStore.threadInfos[activeThread];
+ // TODO (atul): Try to get rid of this ridiculous branching.
+ if (activeThreadInfo.minimallyEncoded) {
+ const updatedActiveThreadInfo = {
+ ...activeThreadInfo,
+ currentUser: {
+ ...activeThreadInfo.currentUser,
+ unread: false,
},
- },
- ];
+ };
- const updatedThreadStore = threadStoreOpsHandlers.processStoreOperations(
- state.threadStore,
- threadStoreOperations,
- );
+ const threadStoreOperations = [
+ {
+ type: 'replace',
+ payload: {
+ id: activeThread,
+ threadInfo: updatedActiveThreadInfo,
+ },
+ },
+ ];
- return {
- state: { ...state, threadStore: updatedThreadStore },
- threadStoreOperations,
- };
+ const updatedThreadStore = threadStoreOpsHandlers.processStoreOperations(
+ state.threadStore,
+ threadStoreOperations,
+ );
+
+ return {
+ state: { ...state, threadStore: updatedThreadStore },
+ threadStoreOperations,
+ };
+ } else {
+ const updatedActiveThreadInfo = {
+ ...activeThreadInfo,
+ currentUser: {
+ ...activeThreadInfo.currentUser,
+ unread: false,
+ },
+ };
+
+ const threadStoreOperations = [
+ {
+ type: 'replace',
+ payload: {
+ id: activeThread,
+ threadInfo: updatedActiveThreadInfo,
+ },
+ },
+ ];
+
+ const updatedThreadStore = threadStoreOpsHandlers.processStoreOperations(
+ state.threadStore,
+ threadStoreOperations,
+ );
+
+ return {
+ state: { ...state, threadStore: updatedThreadStore },
+ threadStoreOperations,
+ };
+ }
}
let appLastBecameInactive = 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 6:59 PM (11 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2708187
Default Alt Text
D10280.id34608.diff (2 KB)
Attached To
Mode
D10280: [native] Add branching to `fixUnreadActiveThread` to support `RawThreadInfos`
Attached
Detach File
Event Timeline
Log In to Comment