diff --git a/web/src/routes/display/+page.svelte b/web/src/routes/display/+page.svelte index 995cbea..7c571c5 100644 --- a/web/src/routes/display/+page.svelte +++ b/web/src/routes/display/+page.svelte @@ -12,6 +12,7 @@ }; } + let withSound = false; let persisted: PersistedState = new PersistedState("calls", []); let calls = $state($state.snapshot(persisted.current)); let newCalls = $state([]); @@ -20,6 +21,7 @@ let connected = $state(false); onMount(() => { + withSound = location.search.includes("sound=true"); eventTarget.addEventListener("display", (e) => { const detail = (e as CustomEvent).detail; const _newCalls = detail.tickets.filter( @@ -29,6 +31,10 @@ persisted.current = calls; connected = true; if (!firstLoad) { + if (_newCalls.length > 0 && withSound) { + const audio = new Audio("/call.wav"); + audio.play(); + } newCalls.push(..._newCalls); setTimeout(() => { newCalls = newCalls.filter((c) => _newCalls.includes(c)); diff --git a/web/static/call.wav b/web/static/call.wav new file mode 100644 index 0000000..eb4b966 Binary files /dev/null and b/web/static/call.wav differ