fix: endless preview

This commit is contained in:
Felix Roos 2023-03-15 23:01:56 +01:00
parent 8a22c5627a
commit a33ce67dd4

View File

@ -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 (