Fixed mentions not updating when team switched (#3807)

This commit is contained in:
David Lu
2016-08-15 17:37:12 -04:00
committed by enahum
parent 7a2ca395d1
commit 782d5f64e7

View File

@@ -79,8 +79,13 @@ export default class Sidebar extends React.Component {
const unreadCounts = this.state.unreadCounts;
Object.keys(unreadCounts).forEach((chId) => {
msgs += unreadCounts[chId].msgs;
mentions += unreadCounts[chId].mentions;
const channel = ChannelStore.get(chId);
if (channel) {
if (channel.team_id === this.state.currentTeam.id) {
msgs += unreadCounts[chId].msgs;
mentions += unreadCounts[chId].mentions;
}
}
});
return {msgs, mentions};