From e5a770a373641fa317f0ef48a8fbc7a2532720ac Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 26 Oct 2016 13:19:36 +0100 Subject: [PATCH] Don't send read receipt if user has logged out --- src/components/structures/TimelinePanel.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index f2db2790d1..06e38ffb5a 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -431,6 +431,10 @@ var TimelinePanel = React.createClass({ sendReadReceipt: function() { if (!this.refs.messagePanel) return; if (!this.props.manageReadReceipts) return; + // This happens on user_activity_end which is delayed, and it's + // very possible have logged out within that timeframe, so check + // we still have a client. + if (!MatrixClientPeg.get()) return; // if we are scrolled to the bottom, do a quick-reset of our unreadNotificationCount // to avoid having to wait from the remote echo from the homeserver.