document thie this. check

This commit is contained in:
Shpuld Shpuldson 2020-10-29 12:45:44 +02:00
parent 6acb61f296
commit 3ead79ddb4
1 changed files with 1 additions and 0 deletions

View File

@ -240,6 +240,7 @@ const Chat = {
// arrive just as you're leaving the view and messages that you didn't actually // arrive just as you're leaving the view and messages that you didn't actually
// get to see get marked as read. // get to see get marked as read.
window.setTimeout(() => { window.setTimeout(() => {
// Don't mark as read if the element doesn't exist, user has left chat view
if (this.$el) this.readChat() if (this.$el) this.readChat()
}, MARK_AS_READ_DELAY) }, MARK_AS_READ_DELAY)
} }