summaryrefslogtreecommitdiffstats
path: root/webapp/components/notify_counts.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-04-28 10:56:19 -0400
committerChristopher Speller <crspeller@gmail.com>2016-04-28 10:56:19 -0400
commit383cddd3d14107fabea28e09f5f9401623cd19d5 (patch)
treef0aedc438756bf41aa29aa5f3518e83f40e95da1 /webapp/components/notify_counts.jsx
parent3dbb5ab4cca74de7d7a00909927e1f034949052d (diff)
downloadchat-383cddd3d14107fabea28e09f5f9401623cd19d5.tar.gz
chat-383cddd3d14107fabea28e09f5f9401623cd19d5.tar.bz2
chat-383cddd3d14107fabea28e09f5f9401623cd19d5.zip
Don't return error if already part of channel being joined (#2814)
Diffstat (limited to 'webapp/components/notify_counts.jsx')
-rw-r--r--webapp/components/notify_counts.jsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/webapp/components/notify_counts.jsx b/webapp/components/notify_counts.jsx
index 9238c8736..8f9eadab7 100644
--- a/webapp/components/notify_counts.jsx
+++ b/webapp/components/notify_counts.jsx
@@ -9,8 +9,12 @@ function getCountsStateFromStores() {
var channels = ChannelStore.getAll();
var members = ChannelStore.getAllMembers();
- channels.forEach(function setChannelInfo(channel) {
+ channels.forEach((channel) => {
var channelMember = members[channel.id];
+ if (channelMember == null) {
+ return;
+ }
+
if (channel.type === 'D') {
count += channel.total_msg_count - channelMember.msg_count;
} else if (channelMember.mention_count > 0) {
@@ -20,7 +24,7 @@ function getCountsStateFromStores() {
}
});
- return {count: count};
+ return {count};
}
import React from 'react';