diff --git a/lib/reducers/thread-reducer.js b/lib/reducers/thread-reducer.js --- a/lib/reducers/thread-reducer.js +++ b/lib/reducers/thread-reducer.js @@ -219,7 +219,8 @@ action.type === processUpdatesActionType || action.type === newThreadActionTypes.success ) { - if (action.payload.updatesResult.newUpdates.length === 0) { + const { newUpdates } = action.payload.updatesResult; + if (newUpdates.length === 0) { return { threadStore: state, newThreadInconsistencies: [], @@ -240,18 +241,19 @@ threadStoreOperations, }; } else if (action.type === updateSubscriptionActionTypes.success) { + const { threadID, subscription } = action.payload; const newThreadInfo = { - ...state.threadInfos[action.payload.threadID], + ...state.threadInfos[threadID], currentUser: { - ...state.threadInfos[action.payload.threadID].currentUser, - subscription: action.payload.subscription, + ...state.threadInfos[threadID].currentUser, + subscription, }, }; const threadStoreOperations = [ { type: 'replace', payload: { - id: action.payload.threadID, + id: threadID, threadInfo: newThreadInfo, }, },