Remove unneeded return and add logging for marking channels unread (#6788)

Этот коммит содержится в:
Joram Wilander
2017-06-28 20:56:14 -04:00
коммит произвёл enahum
родитель c6602ae2b8
Коммит 2a96b7e15e

Просмотреть файл

@@ -448,7 +448,8 @@ class ChannelStoreClass extends EventEmitter {
incrementMessages(id, markRead = false) { incrementMessages(id, markRead = false) {
if (!this.unreadCounts[id]) { 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); const member = this.getMyMember(id);
@@ -483,11 +484,11 @@ class ChannelStoreClass extends EventEmitter {
} }
if (!this.unreadCounts[id]) { 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) { if (mentions.indexOf(UserStore.getCurrentId()) !== -1) {
this.unreadCounts[id].mentions++;
const member = {...this.getMyMember(id)}; const member = {...this.getMyMember(id)};
member.mention_count++; member.mention_count++;
store.dispatch({ store.dispatch({