From fcd7723f73f1e89f4ea9fabd6e0c03c4c8a4ffd4 Mon Sep 17 00:00:00 2001 From: Alliegaytor <61523203+Alliegaytor@users.noreply.github.com> Date: Sun, 24 Sep 2023 14:31:02 +1000 Subject: [PATCH] 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) --- src/client/state/Notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);