diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index 81cc957cb..b074e00f1 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -336,7 +336,9 @@ function InviteNotifications() { if (quietActive) return; - if (showNotifications && notificationPermission('granted')) { + // [Gitea #324] The in-app toast (focused window) needs no browser + // permission; only the OS notification does. + if (showNotifications && (document.hasFocus() || notificationPermission('granted'))) { notify(newCount); } if (notificationSound && inviteSoundId !== 'none') { @@ -648,7 +650,11 @@ function MessageNotifications() { if (quietActive) return; - if (showNotifications && notificationPermission('granted')) { + // [Gitea #324] notify() shows an in-app toast while the window is focused, + // which needs no browser permission; only its OS-notification path does. + // Gating both on the permission left people who declined it (most web + // users) with a ping sound and nothing on screen. + if (showNotifications && (document.hasFocus() || notificationPermission('granted'))) { const avatarMxc = room.getAvatarFallbackMember()?.getMxcAvatarUrl() ?? room.getMxcAvatarUrl(); notify({