diff --git a/ts/state/selectors/conversations.ts b/ts/state/selectors/conversations.ts index 869be2742..f580406f3 100644 --- a/ts/state/selectors/conversations.ts +++ b/ts/state/selectors/conversations.ts @@ -223,10 +223,6 @@ export const getUnreadMessageCount = createSelector(getLeftPaneLists, (state): n }); export const getNumberOfPinnedConversations = createSelector(getConversations, (state): number => { - let count = 0; - for (let key in state.conversationLookup) { - let value = state.conversationLookup[key]; - if (value.isPinned) count++; - } - return count; + const values = Object.values(state.conversationLookup); + return values.filter(conversation => conversation.isPinned).length; });