From 2cdf015217e32b75eca89078ebfd1e6755f5aadf Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sat, 10 Oct 2026 17:49:05 +0200 Subject: [PATCH] fix: Browser Notifications switch stays on after the browser denies permission (#32170) Turning on Browser Notifications in a browser that blocks them showed an error, but the switch stayed on even though nothing was saved. The switch now turns back off when the browser denies permission. Fixes #32024 --- src/lib/components/chat/Settings/Notifications.svelte | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/components/chat/Settings/Notifications.svelte b/src/lib/components/chat/Settings/Notifications.svelte index e6207c92c6..f9d9517a3c 100644 --- a/src/lib/components/chat/Settings/Notifications.svelte +++ b/src/lib/components/chat/Settings/Notifications.svelte @@ -61,13 +61,13 @@ } const toggleNotifications = async () => { - if (!notificationEnabled) { + if (notificationEnabled) { const permission = 'Notification' in window ? await Notification.requestPermission() : 'denied'; if (permission === 'granted') { - notificationEnabled = true; saveSettings({ notificationEnabled }); } else { + notificationEnabled = false; toast.error( $i18n.t( 'Response notifications cannot be activated as the website permissions have been denied. Please visit your browser settings to grant the necessary access.' @@ -75,7 +75,6 @@ ); } } else { - notificationEnabled = false; saveSettings({ notificationEnabled }); } }; @@ -203,7 +202,7 @@ {$i18n.t('settings.personal.notifications.browserNotifications.label')}