Commit 6ba84327 authored by Sudheer's avatar Sudheer Committed by sudheer

MM-13432 Fix DM and GM mention counts missing from browser tab (#2249)

* Use updated redux selector for unread count
parent ce5e6646
......@@ -3,13 +3,13 @@
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {createSelector} from 'reselect';
import {Preferences} from 'mattermost-redux/constants/index';
import {
getCurrentChannel,
getSortedUnreadChannelIds,
getOrderedChannelIds,
getUnreads,
} from 'mattermost-redux/selectors/entities/channels';
import Permissions from 'mattermost-redux/constants/permissions';
......@@ -17,7 +17,7 @@ import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {getBool as getBoolPreference, getSidebarPreferences} from 'mattermost-redux/selectors/entities/preferences';
import {getCurrentUser} from 'mattermost-redux/selectors/entities/users';
import {haveITeamPermission} from 'mattermost-redux/selectors/entities/roles';
import {getCurrentTeam, getMyTeams, getTeamMemberships} from 'mattermost-redux/selectors/entities/teams';
import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams';
import {switchToChannelById} from 'actions/views/channel';
import {openModal} from 'actions/views/modals';
......@@ -26,20 +26,6 @@ import {getIsLhsOpen} from 'selectors/lhs';
import Sidebar from './sidebar.jsx';
const getTotalUnreads = createSelector(
getMyTeams,
getTeamMemberships,
(myTeams, myTeamMemberships) => {
return myTeams.reduce((acc, team) => {
const member = myTeamMemberships[team.id];
acc.messageCount += member.msg_count;
acc.mentionCount += member.mention_count;
return acc;
}, {messageCount: 0, mentionCount: 0});
}
);
function mapStateToProps(state) {
const config = getConfig(state);
const currentChannel = getCurrentChannel(state);
......@@ -80,7 +66,7 @@ function mapStateToProps(state) {
canCreatePublicChannel,
canCreatePrivateChannel,
isOpen: getIsLhsOpen(state),
unreads: getTotalUnreads(state),
unreads: getUnreads(state),
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment