add document.hasFocus check for incoming room events (#1252)
This commit is contained in:
parent
da92ce3a46
commit
2055d7a07f
1 changed files with 1 additions and 1 deletions
|
@ -358,7 +358,7 @@ function useEventArrive(roomTimeline, readUptoEvtStore, timelineScrollRef, event
|
||||||
const isViewingLive = roomTimeline.isServingLiveTimeline() && limit.length >= tLength - 1;
|
const isViewingLive = roomTimeline.isServingLiveTimeline() && limit.length >= tLength - 1;
|
||||||
const isAttached = timelineScroll.bottom < SCROLL_TRIGGER_POS;
|
const isAttached = timelineScroll.bottom < SCROLL_TRIGGER_POS;
|
||||||
|
|
||||||
if (isViewingLive && isAttached) {
|
if (isViewingLive && isAttached && document.hasFocus()) {
|
||||||
limit.setFrom(tLength - limit.maxEvents);
|
limit.setFrom(tLength - limit.maxEvents);
|
||||||
trySendReadReceipt(event);
|
trySendReadReceipt(event);
|
||||||
setEvent(event);
|
setEvent(event);
|
||||||
|
|
Loading…
Reference in a new issue