enh: option to toggle notification sound

This commit is contained in:
Timothy Jaeryang Baek
2024-12-25 13:49:24 -07:00
parent 645313e321
commit 798886105e
2 changed files with 35 additions and 2 deletions
+5 -2
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { settings } from '$lib/stores';
import DOMPurify from 'dompurify';
import { marked } from 'marked';
@@ -11,8 +12,10 @@
export let content: string;
onMount(() => {
const audio = new Audio(`/audio/notification.mp3`);
audio.play();
if ($settings?.notificationSound ?? true) {
const audio = new Audio(`/audio/notification.mp3`);
audio.play();
}
});
</script>