From 2a96b7e15ea0a6da2d5397140aff9478945d8828 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 28 Jun 2017 20:56:14 -0400 Subject: Remove unneeded return and add logging for marking channels unread (#6788) --- webapp/stores/channel_store.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'webapp/stores') diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx index 58ea19419..1ffad280f 100644 --- a/webapp/stores/channel_store.jsx +++ b/webapp/stores/channel_store.jsx @@ -448,7 +448,8 @@ class ChannelStoreClass extends EventEmitter { incrementMessages(id, markRead = false) { if (!this.unreadCounts[id]) { - return; + // Should never happen + console.log(`Missing channel_id=${id} in unreads object`); //eslint-disable-line no-console } const member = this.getMyMember(id); @@ -483,11 +484,11 @@ class ChannelStoreClass extends EventEmitter { } if (!this.unreadCounts[id]) { - return; + // Should never happen + console.log(`Missing channel_id=${id} in unreads object`); //eslint-disable-line no-console } if (mentions.indexOf(UserStore.getCurrentId()) !== -1) { - this.unreadCounts[id].mentions++; const member = {...this.getMyMember(id)}; member.mention_count++; store.dispatch({ -- cgit v1.2.3-1-g7c22