Chats: fix error loading chatroom page

better-thread-display
Alex Gleason 2020-09-04 17:16:23 -05:00
rodzic ad3aa296cd
commit 8e6a662fbb
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -58,11 +58,11 @@ class ChatRoom extends ImmutablePureComponent {
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
const markReadConditions = [ const markReadConditions = [
() => this.props.chat !== undefined, () => this.props.chat,
() => this.props.chat.get('unread') > 0, () => this.props.chat.get('unread') > 0,
]; ];
if (markReadConditions.every(c => c() === true)) if (markReadConditions.every(c => c()))
this.markRead(); this.markRead();
} }