From c6641dba3153f07f656b3f7fd8cd56376c44e602 Mon Sep 17 00:00:00 2001 From: Matthew Remmel Date: Wed, 24 Sep 2025 13:50:01 -0400 Subject: [PATCH] Move notification sound and badge settings to settings store --- src/app/components/Alerts.svelte | 13 ++++++------- src/app/components/NewNotificationSound.svelte | 4 ++-- src/app/core/state.ts | 16 ++++------------ src/app/util/notifications.ts | 4 ++-- 4 files changed, 14 insertions(+), 23 deletions(-) diff --git a/src/app/components/Alerts.svelte b/src/app/components/Alerts.svelte index 3693e25..c7c4f06 100644 --- a/src/app/components/Alerts.svelte +++ b/src/app/components/Alerts.svelte @@ -16,8 +16,7 @@ deriveAlertStatus, userInboxRelays, getAlertFeed, - showUnreadBadge, - playAlertSound, + userSettingsValues, } from "@app/core/state" import {deleteAlert, createDmAlert} from "@app/core/commands" import {clearBadges} from "../util/notifications" @@ -74,15 +73,15 @@ } const onShowBadgeOnUnreadToggle = async () => { - $showUnreadBadge = !$showUnreadBadge + $userSettingsValues.show_notifications_badge = !$userSettingsValues.show_notifications_badge - if (!$showUnreadBadge) { + if (!$userSettingsValues.show_notifications_badge) { await clearBadges() } } const onDirectMessagesNotificationSoundToggle = async () => { - $playAlertSound = !$playAlertSound + $userSettingsValues.play_notification_sound = !$userSettingsValues.play_notification_sound } let directMessagesNotificationToggle: HTMLInputElement @@ -123,7 +122,7 @@
@@ -131,7 +130,7 @@
{#if $dmStatus} diff --git a/src/app/components/NewNotificationSound.svelte b/src/app/components/NewNotificationSound.svelte index ee9889d..8e95d84 100644 --- a/src/app/components/NewNotificationSound.svelte +++ b/src/app/components/NewNotificationSound.svelte @@ -1,6 +1,6 @@