Browse Source

refac: notification sound behaviour

Timothy Jaeryang Baek 4 tháng trước cách đây
mục cha
commit
996ade9090
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      src/lib/components/NotificationToast.svelte

+ 4 - 0
src/lib/components/NotificationToast.svelte

@@ -12,6 +12,10 @@
 	export let content: string;
 
 	onMount(() => {
+		if (!navigator.userActivation.hasBeenActive) {
+			return;
+		}
+
 		if ($settings?.notificationSound ?? true) {
 			const audio = new Audio(`/audio/notification.mp3`);
 			audio.play();