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 @@ -327,64 +327,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);