From 5d55e6572766169ea67c79caced692b8c7013058 Mon Sep 17 00:00:00 2001 From: simosmik Date: Tue, 3 Mar 2026 13:30:19 +0000 Subject: [PATCH] default to false for webpush notifications and translations for the button --- server/database/db.js | 4 +- .../view/tabs/NotificationsSettingsTab.tsx | 44 +++++++++++++------ src/i18n/locales/en/settings.json | 3 +- src/i18n/locales/ja/settings.json | 3 +- src/i18n/locales/ko/settings.json | 3 +- src/i18n/locales/zh-CN/settings.json | 3 +- 6 files changed, 40 insertions(+), 20 deletions(-) diff --git a/server/database/db.js b/server/database/db.js index 30b63c67..3db5e4e1 100644 --- a/server/database/db.js +++ b/server/database/db.js @@ -381,7 +381,7 @@ const credentialsDb = { const DEFAULT_NOTIFICATION_PREFERENCES = { channels: { inApp: false, - webPush: true + webPush: false }, events: { actionRequired: true, @@ -396,7 +396,7 @@ const normalizeNotificationPreferences = (value) => { return { channels: { inApp: source.channels?.inApp === true, - webPush: source.channels?.webPush !== false + webPush: source.channels?.webPush === true }, events: { actionRequired: source.events?.actionRequired !== false, diff --git a/src/components/settings/view/tabs/NotificationsSettingsTab.tsx b/src/components/settings/view/tabs/NotificationsSettingsTab.tsx index 4187d524..a9607407 100644 --- a/src/components/settings/view/tabs/NotificationsSettingsTab.tsx +++ b/src/components/settings/view/tabs/NotificationsSettingsTab.tsx @@ -1,4 +1,4 @@ -import { Bell } from 'lucide-react'; +import { Bell, BellOff, BellRing, Loader2 } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import type { NotificationPreferencesState } from '../../types/types'; @@ -43,26 +43,42 @@ export default function NotificationsSettingsTab({ ) : pushDenied ? (

{t('notifications.webPush.denied')}

) : ( -