Chats: fix error loading chatroom page

This commit is contained in:
Alex Gleason 2020-09-04 17:16:23 -05:00
parent ad3aa296cd
commit 8e6a662fbb
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

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