summaryrefslogtreecommitdiffstats
path: root/webapp/components/notify_counts.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-04-28 17:03:59 -0700
committer=Corey Hulen <corey@hulen.com>2016-04-28 17:03:59 -0700
commit62901defaebb8f3524bdfcad86b2576cfd9fe587 (patch)
treeb0740451c56c68c5284834fd02bbce4d831acc17 /webapp/components/notify_counts.jsx
parentad9dfc9c42b6597515d9eb0a96e9f069372dffdd (diff)
parentf3fa435a1b35c2ada4cd9a81744a41904fe97909 (diff)
downloadchat-62901defaebb8f3524bdfcad86b2576cfd9fe587.tar.gz
chat-62901defaebb8f3524bdfcad86b2576cfd9fe587.tar.bz2
chat-62901defaebb8f3524bdfcad86b2576cfd9fe587.zip
Merge branch 'master' of https://github.com/mattermost/platform
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';