summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lu <david.lu97@outlook.com>2016-08-15 17:37:12 -0400
committerenahum <nahumhbl@gmail.com>2016-08-15 16:37:12 -0500
commit782d5f64e7661f123be112e67037b99cea180923 (patch)
tree2358d312185ff94aa7a9df06c70609c5e1fbd5bc
parent7a2ca395d148cc58b5caa8802c40f8e6089fa412 (diff)
downloadchat-782d5f64e7661f123be112e67037b99cea180923.tar.gz
chat-782d5f64e7661f123be112e67037b99cea180923.tar.bz2
chat-782d5f64e7661f123be112e67037b99cea180923.zip
Fixed mentions not updating when team switched (#3807)
-rw-r--r--webapp/components/sidebar.jsx9
1 files changed, 7 insertions, 2 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx
index cd00c65dd..4c11bb985 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};