fix(desktop): restore notification sounds (#2582)
Restore desktop notification sounds by default, add a persisted Play sound setting, and group notification permission and testing in a dedicated Notifications section.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import path from "node:path";
|
||||
import { existsSync } from "node:fs";
|
||||
import { app, BrowserWindow, Notification, ipcMain, nativeImage } from "electron";
|
||||
import { getDesktopSettingsStore } from "../settings/desktop-settings-electron.js";
|
||||
|
||||
interface NotificationInput {
|
||||
title?: unknown;
|
||||
@@ -95,11 +96,12 @@ export function registerNotificationHandlers(): void {
|
||||
const body = toTrimmedString(rawInput?.body) ?? undefined;
|
||||
const data = toRecord(rawInput?.data);
|
||||
const icon = getNotificationIcon();
|
||||
const settings = await getDesktopSettingsStore().get();
|
||||
const notification = new Notification({
|
||||
title,
|
||||
...(body ? { body } : {}),
|
||||
...(icon ? { icon } : {}),
|
||||
silent: true,
|
||||
silent: !settings.notifications.playSound,
|
||||
});
|
||||
|
||||
activeNotifications.add(notification);
|
||||
|
||||
Reference in New Issue
Block a user