From 2055d7a07fdd0a1faf25deb3be040f6de7932023 Mon Sep 17 00:00:00 2001 From: Thumbscrew Date: Sun, 28 May 2023 16:54:10 +0100 Subject: [PATCH] add document.hasFocus check for incoming room events (#1252) --- src/app/organisms/room/RoomViewContent.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/organisms/room/RoomViewContent.jsx b/src/app/organisms/room/RoomViewContent.jsx index 74bc7e2..0a9256c 100644 --- a/src/app/organisms/room/RoomViewContent.jsx +++ b/src/app/organisms/room/RoomViewContent.jsx @@ -358,7 +358,7 @@ function useEventArrive(roomTimeline, readUptoEvtStore, timelineScrollRef, event const isViewingLive = roomTimeline.isServingLiveTimeline() && limit.length >= tLength - 1; const isAttached = timelineScroll.bottom < SCROLL_TRIGGER_POS; - if (isViewingLive && isAttached) { + if (isViewingLive && isAttached && document.hasFocus()) { limit.setFrom(tLength - limit.maxEvents); trySendReadReceipt(event); setEvent(event);