Page MenuHomePhabricator

D10811.id36329.diff
No OneTemporary

D10811.id36329.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
@@ -335,64 +335,33 @@
}
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 updatedActiveThreadInfo = {
+ ...activeThreadInfo,
+ currentUser: {
+ ...activeThreadInfo.currentUser,
+ unread: false,
+ },
+ };
+
+ const threadStoreOperations = [
+ {
+ type: 'replace',
+ payload: {
+ id: activeThread,
+ threadInfo: updatedActiveThreadInfo,
},
- };
-
- const threadStoreOperations = [
- {
- type: 'replace',
- payload: {
- id: activeThread,
- threadInfo: updatedActiveThreadInfo,
- },
- },
- ];
-
- 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,
- );
+ const updatedThreadStore = threadStoreOpsHandlers.processStoreOperations(
+ state.threadStore,
+ threadStoreOperations,
+ );
- return {
- state: { ...state, threadStore: updatedThreadStore },
- threadStoreOperations,
- };
- }
+ return {
+ state: { ...state, threadStore: updatedThreadStore },
+ threadStoreOperations,
+ };
}
let appLastBecameInactive = 0;
diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js
--- a/web/redux/redux-setup.js
+++ b/web/redux/redux-setup.js
@@ -312,36 +312,19 @@
) {
// Makes sure a currently focused thread is never unread
const activeThreadInfo = state.threadStore.threadInfos[activeThread];
- // TODO (atul): Try to get rid of this ridiculous branching.
- if (activeThreadInfo.minimallyEncoded) {
- updateActiveThreadOps.push({
- type: 'replace',
- payload: {
- id: activeThread,
- threadInfo: {
- ...activeThreadInfo,
- currentUser: {
- ...activeThreadInfo.currentUser,
- unread: false,
- },
+ updateActiveThreadOps.push({
+ type: 'replace',
+ payload: {
+ id: activeThread,
+ threadInfo: {
+ ...activeThreadInfo,
+ currentUser: {
+ ...activeThreadInfo.currentUser,
+ unread: false,
},
},
- });
- } else {
- updateActiveThreadOps.push({
- type: 'replace',
- payload: {
- id: activeThread,
- threadInfo: {
- ...activeThreadInfo,
- currentUser: {
- ...activeThreadInfo.currentUser,
- unread: false,
- },
- },
- },
- });
- }
+ },
+ });
}
const oldActiveThread = activeThreadSelector(oldState);

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 4:08 AM (20 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573763
Default Alt Text
D10811.id36329.diff (3 KB)

Event Timeline