diff --git a/src/app/components/Alerts.svelte b/src/app/components/Alerts.svelte index 8516f54e6..fa84626d9 100644 --- a/src/app/components/Alerts.svelte +++ b/src/app/components/Alerts.svelte @@ -10,7 +10,15 @@ import AlertItem from "@app/components/AlertItem.svelte" import {pushModal} from "@app/util/modal" import {pushToast} from "@app/util/toast" - import {alerts, dmAlert, deriveAlertStatus, userInboxRelays, getAlertFeed} from "@app/core/state" + import { + alerts, + dmAlert, + deriveAlertStatus, + userInboxRelays, + getAlertFeed, + showUnreadBadge, + playAlertSound, + } from "@app/core/state" import {deleteAlert, createDmAlert} from "@app/core/commands" type Props = { @@ -42,11 +50,11 @@ const uncheckDmAlert = async (message: string) => { await sleep(100) - toggle.checked = false + directMessagesNotificationToggle.checked = false pushToast({theme: "error", message}) } - const onToggle = async () => { + const onDirectMessagesNotificationToggle = async () => { if ($dmAlert) { deleteAlert($dmAlert) } else { @@ -64,7 +72,15 @@ } } - let toggle: HTMLInputElement + const onShowBadgeOnUnreadToggle = async () => { + $showUnreadBadge = !$showUnreadBadge + } + + const onDirectMessagesNotificationSoundToggle = async () => { + $playAlertSound = !$playAlertSound + } + + let directMessagesNotificationToggle: HTMLInputElement
Show badge for unread direct messages
+ +Play sound for new direct messages
+