add document.hasFocus check for incoming room events (#1252)

This commit is contained in:
Thumbscrew 2023-05-28 16:54:10 +01:00 committed by GitHub
parent da92ce3a46
commit 2055d7a07f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);