Explorar el Código

refac: notification sound behaviour

Timothy Jaeryang Baek hace 4 meses
padre
commit
996ade9090
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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();