diff --git a/website/src/repl/Footer.jsx b/website/src/repl/Footer.jsx index 187aca18..2bce3e70 100644 --- a/website/src/repl/Footer.jsx +++ b/website/src/repl/Footer.jsx @@ -248,9 +248,10 @@ function SoundsTab() { const trigRef = useRef(); // stop current sound on mouseup useEvent('mouseup', () => { - trigRef.current?.then((ref) => { + const t = trigRef.current; + trigRef.current = undefined; + t?.then((ref) => { ref?.stop(getAudioContext().currentTime + 0.01); - trigRef.current = undefined; }); }); return (