summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webapp/components/sidebar.jsx9
-rw-r--r--webapp/stores/channel_store.jsx1
2 files changed, 4 insertions, 6 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx
index 27fec8822..ad2d6c45c 100644
--- a/webapp/components/sidebar.jsx
+++ b/webapp/components/sidebar.jsx
@@ -81,11 +81,10 @@ export default class Sidebar extends React.Component {
Object.keys(unreadCounts).forEach((chId) => {
const channel = ChannelStore.get(chId);
- if (channel) {
- if (channel.team_id === this.state.currentTeam.id) {
- msgs += unreadCounts[chId].msgs;
- mentions += unreadCounts[chId].mentions;
- }
+
+ if (channel && (!channel.team_id || channel.team_id === this.state.currentTeam.id)) {
+ msgs += unreadCounts[chId].msgs;
+ mentions += unreadCounts[chId].mentions;
}
});
diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx
index 8fc0df17f..0f2ef9dc0 100644
--- a/webapp/stores/channel_store.jsx
+++ b/webapp/stores/channel_store.jsx
@@ -329,7 +329,6 @@ class ChannelStoreClass extends EventEmitter {
if (ch.type === 'D') {
chMentionCount = chUnreadCount;
- chUnreadCount = 0;
} else if (chMember.notify_props && chMember.notify_props.mark_unread === NotificationPrefs.MENTION) {
chUnreadCount = 0;
}