Files
hikari-desktop/src/lib/stores/notifications.ts
T
naomi fa04d066e5
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 52s
CI / Lint & Test (pull_request) Failing after 7m33s
CI / Build Linux (pull_request) Has been skipped
CI / Build Windows (cross-compile) (pull_request) Has been skipped
feat: add notification sounds
2026-01-19 15:24:20 -08:00

23 lines
715 B
TypeScript

import { derived } from "svelte/store";
import { configStore } from "./config";
import { soundPlayer } from "$lib/notifications";
// Sync notification settings with config
export const notificationSettings = derived(configStore.config, ($config) => {
soundPlayer.setEnabled($config.notifications_enabled);
soundPlayer.setGlobalVolume($config.notification_volume);
return {
enabled: $config.notifications_enabled,
volume: $config.notification_volume,
};
});
// Helper to update notification settings
export async function updateNotificationSettings(enabled: boolean, volume: number) {
await configStore.updateConfig({
notifications_enabled: enabled,
notification_volume: volume,
});
}