Merge pull request 'fix(notifications): in-app toasts no longer need browser notification permission (#324)' (#395) from fix/inapp-toast-permission into lotus
CI / Build & Quality Checks (push) Canceled after 0s
CI / Trigger Desktop Build (push) Canceled after 0s
CI / Secret scan (gitleaks) (push) Canceled after 0s
CI / Docker image build & smoke test (push) Canceled after 0s
CI / Playwright smoke (e2e) (push) Canceled after 0s
CI / Build & Quality Checks (push) Canceled after 0s
CI / Trigger Desktop Build (push) Canceled after 0s
CI / Secret scan (gitleaks) (push) Canceled after 0s
CI / Docker image build & smoke test (push) Canceled after 0s
CI / Playwright smoke (e2e) (push) Canceled after 0s
This commit was merged in pull request #395.
This commit is contained in:
@@ -336,7 +336,9 @@ function InviteNotifications() {
|
|||||||
|
|
||||||
if (quietActive) return;
|
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);
|
notify(newCount);
|
||||||
}
|
}
|
||||||
if (notificationSound && inviteSoundId !== 'none') {
|
if (notificationSound && inviteSoundId !== 'none') {
|
||||||
@@ -648,7 +650,11 @@ function MessageNotifications() {
|
|||||||
|
|
||||||
if (quietActive) return;
|
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 =
|
const avatarMxc =
|
||||||
room.getAvatarFallbackMember()?.getMxcAvatarUrl() ?? room.getMxcAvatarUrl();
|
room.getAvatarFallbackMember()?.getMxcAvatarUrl() ?? room.getMxcAvatarUrl();
|
||||||
notify({
|
notify({
|
||||||
|
|||||||
Reference in New Issue
Block a user