memory optimization

pull/1770/head
Brice-W 4 years ago
parent c3bf2a4e96
commit 21b8b9f35b

@ -223,6 +223,10 @@ export const getUnreadMessageCount = createSelector(getLeftPaneLists, (state): n
}); });
export const getNumberOfPinnedConversations = createSelector(getConversations, (state): number => { export const getNumberOfPinnedConversations = createSelector(getConversations, (state): number => {
const values = Object.values(state.conversationLookup); let count = 0;
return values.filter(conversation => conversation.isPinned).length; for (let key in state.conversationLookup) {
let value = state.conversationLookup[key];
if (value.isPinned) count++;
}
return count;
}); });

Loading…
Cancel
Save