Page MenuHomePhabricator

D10280.id34608.diff
No OneTemporary

D10280.id34608.diff

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

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)

Event Timeline