From 8dd278f47c9af6d6d4255445cd5981608d356c19 Mon Sep 17 00:00:00 2001 From: userAdityaa Date: Fri, 29 May 2026 15:13:10 +0000 Subject: [PATCH] fix: turn on notification defaults and prompt on first DM visit (#284) Co-authored-by: userAdityaa Co-committed-by: userAdityaa --- src/app/components/SpaceInviteAccept.svelte | 2 +- src/app/components/SpaceJoin.svelte | 2 +- src/app/core/state.ts | 2 +- src/app/util/logout.ts | 2 +- src/app/util/notifications.ts | 1 - src/routes/+layout.svelte | 3 +- src/routes/chat/[chat]/+page.svelte | 38 +++++++++++++++++++++ src/routes/settings/alerts/+page.svelte | 3 +- 8 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/app/components/SpaceInviteAccept.svelte b/src/app/components/SpaceInviteAccept.svelte index 158563f9..228e2441 100644 --- a/src/app/components/SpaceInviteAccept.svelte +++ b/src/app/components/SpaceInviteAccept.svelte @@ -23,8 +23,8 @@ import SpaceJoinSettings from "@app/components/SpaceJoinSettings.svelte" import {pushToast} from "@app/util/toast" import {makeSpacePath} from "@app/util/routes" - import {Push} from "@app/util/notifications" import {relaysMostlyRestricted, notificationSettings, parseInviteLink} from "@app/core/state" + import {Push} from "@app/util/push" import { attemptRelayAccess, addSpaceMembership, diff --git a/src/app/components/SpaceJoin.svelte b/src/app/components/SpaceJoin.svelte index b684fd24..54e53147 100644 --- a/src/app/components/SpaceJoin.svelte +++ b/src/app/components/SpaceJoin.svelte @@ -24,7 +24,7 @@ import {pushModal} from "@app/util/modal" import {pushToast} from "@app/util/toast" import {makeSpacePath} from "@app/util/routes" - import {Push} from "@app/util/notifications" + import {Push} from "@app/util/push" type Props = { url: string diff --git a/src/app/core/state.ts b/src/app/core/state.ts index 0496d655..374e7701 100644 --- a/src/app/core/state.ts +++ b/src/app/core/state.ts @@ -418,7 +418,7 @@ export const device = withGetter(writable(randomId())) export const notificationSettings = withGetter( writable({ push: false, - sound: false, + sound: true, badge: false, spaces: true, mentions: true, diff --git a/src/app/util/logout.ts b/src/app/util/logout.ts index cef124a7..b1548298 100644 --- a/src/app/util/logout.ts +++ b/src/app/util/logout.ts @@ -1,6 +1,6 @@ import {db, kv, ss} from "@app/core/storage" -import {Push} from "@app/util/notifications" import {deactivateCurrentPomadeSession} from "@app/util/pomade" +import {Push} from "@app/util/push" export const logout = async () => { await deactivateCurrentPomadeSession() diff --git a/src/app/util/notifications.ts b/src/app/util/notifications.ts index 0bc5cb3c..afddca39 100644 --- a/src/app/util/notifications.ts +++ b/src/app/util/notifications.ts @@ -18,7 +18,6 @@ import { } from "@app/core/state" import {kv} from "@app/core/storage" import {page} from "$app/stores" -export {Push} from "@app/util/push" // Checked state diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 42b3f197..f222ab9c 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -37,6 +37,7 @@ import {theme} from "@app/util/theme" import {toast, pushToast} from "@app/util/toast" import * as notifications from "@app/util/notifications" + import {Push} from "@app/util/push" import {onPushNotificationAction} from "@app/util/push/adapters/common" import * as storage from "@app/util/storage" import {syncKeyboard} from "@app/util/keyboard" @@ -175,7 +176,7 @@ unsubscribers.push(notifications.syncChecked()) // Initialize background notifications - unsubscribers.push(notifications.Push.sync()) + unsubscribers.push(Push.sync()) // Listen for signer errors, report to user via toast unsubscribers.push( diff --git a/src/routes/chat/[chat]/+page.svelte b/src/routes/chat/[chat]/+page.svelte index 4239f43a..8af5dd3d 100644 --- a/src/routes/chat/[chat]/+page.svelte +++ b/src/routes/chat/[chat]/+page.svelte @@ -1,13 +1,51 @@ + + diff --git a/src/routes/settings/alerts/+page.svelte b/src/routes/settings/alerts/+page.svelte index 55bc2a7d..b614be7c 100644 --- a/src/routes/settings/alerts/+page.svelte +++ b/src/routes/settings/alerts/+page.svelte @@ -10,7 +10,8 @@ import Icon from "@lib/components/Icon.svelte" import Button from "@lib/components/Button.svelte" import {pushToast} from "@app/util/toast" - import {Push, clearBadges} from "@app/util/notifications" + import {clearBadges} from "@app/util/notifications" + import {Push} from "@app/util/push" import {notificationSettings} from "@app/core/state" const reset = () => {