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 @@ -226,7 +226,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: [], @@ -247,18 +248,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, }, },