From 782d5f64e7661f123be112e67037b99cea180923 Mon Sep 17 00:00:00 2001 From: David Lu Date: Mon, 15 Aug 2016 17:37:12 -0400 Subject: [PATCH] Fixed mentions not updating when team switched (#3807) --- webapp/components/sidebar.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index cd00c65ddd..4c11bb9851 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -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};