diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-04-28 10:56:19 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-04-28 10:56:19 -0400 |
commit | 383cddd3d14107fabea28e09f5f9401623cd19d5 (patch) | |
tree | f0aedc438756bf41aa29aa5f3518e83f40e95da1 /webapp | |
parent | 3dbb5ab4cca74de7d7a00909927e1f034949052d (diff) | |
download | chat-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')
-rw-r--r-- | webapp/components/notify_counts.jsx | 8 |
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'; |