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')}
) : (
-
+ className={`inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${
+ isPushSubscribed
+ ? 'bg-red-100 text-red-700 hover:bg-red-200 dark:bg-red-900/30 dark:text-red-400 dark:hover:bg-red-900/50'
+ : 'bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600'
+ }`}
+ >
+ {isPushLoading ? (
+
+ ) : isPushSubscribed ? (
+
+ ) : (
+
+ )}
+ {isPushLoading
+ ? t('notifications.webPush.loading')
+ : isPushSubscribed
+ ? t('notifications.webPush.disable')
+ : t('notifications.webPush.enable')}
+
+ {isPushSubscribed && (
+
+ {t('notifications.webPush.enabled')}
+
+ )}
+
)}
diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.json
index a07c705b..50598f69 100644
--- a/src/i18n/locales/en/settings.json
+++ b/src/i18n/locales/en/settings.json
@@ -97,8 +97,9 @@
"description": "Control which notification events you receive.",
"webPush": {
"title": "Web Push Notifications",
+ "enable": "Enable Push Notifications",
+ "disable": "Disable Push Notifications",
"enabled": "Push notifications are enabled",
- "disabled": "Enable push notifications",
"loading": "Updating...",
"unsupported": "Push notifications are not supported in this browser.",
"denied": "Push notifications are blocked. Please allow them in your browser settings."
diff --git a/src/i18n/locales/ja/settings.json b/src/i18n/locales/ja/settings.json
index be4c6d1d..a0197341 100644
--- a/src/i18n/locales/ja/settings.json
+++ b/src/i18n/locales/ja/settings.json
@@ -97,8 +97,9 @@
"description": "受信する通知イベントを設定します。",
"webPush": {
"title": "Webプッシュ通知",
+ "enable": "プッシュ通知を有効にする",
+ "disable": "プッシュ通知を無効にする",
"enabled": "プッシュ通知は有効です",
- "disabled": "プッシュ通知を有効にする",
"loading": "更新中...",
"unsupported": "このブラウザではプッシュ通知がサポートされていません。",
"denied": "プッシュ通知がブロックされています。ブラウザの設定で許可してください。"
diff --git a/src/i18n/locales/ko/settings.json b/src/i18n/locales/ko/settings.json
index 34c8c89f..d8ae84f8 100644
--- a/src/i18n/locales/ko/settings.json
+++ b/src/i18n/locales/ko/settings.json
@@ -97,8 +97,9 @@
"description": "수신할 알림 이벤트를 설정합니다.",
"webPush": {
"title": "웹 푸시 알림",
+ "enable": "푸시 알림 활성화",
+ "disable": "푸시 알림 비활성화",
"enabled": "푸시 알림이 활성화되었습니다",
- "disabled": "푸시 알림 활성화",
"loading": "업데이트 중...",
"unsupported": "이 브라우저에서는 푸시 알림이 지원되지 않습니다.",
"denied": "푸시 알림이 차단되었습니다. 브라우저 설정에서 허용해 주세요."
diff --git a/src/i18n/locales/zh-CN/settings.json b/src/i18n/locales/zh-CN/settings.json
index 029e53a5..300060d0 100644
--- a/src/i18n/locales/zh-CN/settings.json
+++ b/src/i18n/locales/zh-CN/settings.json
@@ -97,8 +97,9 @@
"description": "控制你希望接收的通知事件。",
"webPush": {
"title": "Web 推送通知",
+ "enable": "启用推送通知",
+ "disable": "关闭推送通知",
"enabled": "推送通知已启用",
- "disabled": "启用推送通知",
"loading": "更新中...",
"unsupported": "此浏览器不支持推送通知。",
"denied": "推送通知已被阻止,请在浏览器设置中允许。"