web: add notification sound toggle and complete notifications module
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-03-08 22:51:39 +03:00
parent 7889c7a958
commit d7513d7caf
4 changed files with 40 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ export interface AppPreferences {
messageFontSize: number;
sendMode: SendMode;
webNotifications: boolean;
notificationSound: boolean;
privateNotifications: boolean;
groupNotifications: boolean;
channelNotifications: boolean;
@@ -19,6 +20,7 @@ const DEFAULTS: AppPreferences = {
messageFontSize: 16,
sendMode: "enter",
webNotifications: true,
notificationSound: true,
privateNotifications: true,
groupNotifications: true,
channelNotifications: true,
@@ -40,6 +42,7 @@ export function getAppPreferences(): AppPreferences {
messageFontSize: normalizeFontSize(parsed.messageFontSize),
sendMode: parsed.sendMode === "ctrl_enter" ? "ctrl_enter" : "enter",
webNotifications: typeof parsed.webNotifications === "boolean" ? parsed.webNotifications : DEFAULTS.webNotifications,
notificationSound: typeof parsed.notificationSound === "boolean" ? parsed.notificationSound : DEFAULTS.notificationSound,
privateNotifications: typeof parsed.privateNotifications === "boolean" ? parsed.privateNotifications : DEFAULTS.privateNotifications,
groupNotifications: typeof parsed.groupNotifications === "boolean" ? parsed.groupNotifications : DEFAULTS.groupNotifications,
channelNotifications: typeof parsed.channelNotifications === "boolean" ? parsed.channelNotifications : DEFAULTS.channelNotifications,