From 2734f8b501eee04aeb27a34cb604cf8bee17b3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Sun, 1 Dec 2024 12:59:53 +0000 Subject: [PATCH] Simplify visibility check for PWA --- frontend/model/notifications/nativeNotification.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/model/notifications/nativeNotification.js b/frontend/model/notifications/nativeNotification.js index 556c4e9ca..e9d6fcd45 100644 --- a/frontend/model/notifications/nativeNotification.js +++ b/frontend/model/notifications/nativeNotification.js @@ -116,10 +116,8 @@ export function makeNotification ({ title, body, icon, path }: { // If this is a PWA that's not open, display a notification // However, if it's not a PWA that's open, we don't use native notifications if ( - clientList.length !== 1 || self.location.query !== '?standalone=1' || - clientList[0].visibilityState !== 'hidden' || - clientList[0].focused + clientList.some(client => client.focused) ) { return }