Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3351840
D10811.id36340.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D10811.id36340.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
@@ -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
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 3:48 AM (20 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573763
Default Alt Text
D10811.id36340.diff (3 KB)
Attached To
Mode
D10811: [web][native] Remove branching on `minimallyEncoded` in `redux-setup`
Attached
Detach File
Event Timeline
Log In to Comment