From 3bf040f17a31bdf9f4de0f1af23e9132d8551e71 Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Sat, 17 Oct 2026 20:41:48 -0400 Subject: [PATCH] fix(notifications): in-app toasts no longer need browser notification permission (#324) notify() shows an in-page toast while the window is focused and only falls back to an OS notification otherwise, but both message and invite notifications were gated on Notification.permission === granted. Anyone who declined (or was never asked) heard the ping with nothing on screen. Gate only the OS path on the permission. Fixes #324 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5 --- src/app/pages/client/ClientNonUIFeatures.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index 6bf40cbe2..e8e6bccc9 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -334,7 +334,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') { @@ -641,7 +643,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({