From: Alliegaytor <61523203+Alliegaytor@users.noreply.github.com> Date: Sun, 24 Sep 2023 04:31:02 +0000 (+1000) Subject: Fix notifications not displaying when document is not focused (#1425) X-Git-Tag: v3.0.0~28 X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=fcd7723f73f1e89f4ea9fabd6e0c03c4c8a4ffd4;p=rainny.git Fix notifications not displaying when document is not focused (#1425) Allows notifications from the active room while app is not focused (e.g. tabbed out) --- diff --git a/src/client/state/Notifications.js b/src/client/state/Notifications.js index 13dd3e1..09fa240 100644 --- a/src/client/state/Notifications.js +++ b/src/client/state/Notifications.js @@ -234,7 +234,7 @@ class Notifications extends EventEmitter { const actions = this.matrixClient.getPushActionsForEvent(mEvent); if (!actions?.notify) return; - if (navigation.selectedRoomId === room.roomId && document.visibilityState === 'visible') return; + if (navigation.selectedRoomId === room.roomId && document.hasFocus()) return; if (mEvent.isEncrypted()) { await mEvent.attemptDecryption(this.matrixClient.crypto);