set a default idChatOpen value and fix unread messages counter

This commit is contained in:
João Francisco Siebel 2018-12-19 17:25:13 -02:00
parent ad8cc2922c
commit 9cb36f22a7
2 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ class AuthenticatedHandler extends Component {
} = this.state;
Session.set('isChatOpen', false);
Session.set('idChatOpen', '');
Session.set('idChatOpen', 'public');
Session.set('isMeetingEnded', false);
Session.set('isPollOpen', false);
Session.set('breakoutRoomIsOpen', false);

View File

@ -196,7 +196,7 @@ const updateScrollPosition =
);
const updateUnreadMessage = (timestamp) => {
const chatID = Session.get('idChatOpen');
const chatID = Session.get('idChatOpen') || PUBLIC_CHAT_ID;
const isPublic = chatID === PUBLIC_CHAT_ID;
const chatType = isPublic ? PUBLIC_GROUP_CHAT_ID : chatID;
return UnreadMessages.update(chatType, timestamp);