fix: endless preview
This commit is contained in:
parent
8a22c5627a
commit
a33ce67dd4
1 changed files with 3 additions and 2 deletions
|
|
@ -248,9 +248,10 @@ function SoundsTab() {
|
||||||
const trigRef = useRef();
|
const trigRef = useRef();
|
||||||
// stop current sound on mouseup
|
// stop current sound on mouseup
|
||||||
useEvent('mouseup', () => {
|
useEvent('mouseup', () => {
|
||||||
trigRef.current?.then((ref) => {
|
const t = trigRef.current;
|
||||||
|
trigRef.current = undefined;
|
||||||
|
t?.then((ref) => {
|
||||||
ref?.stop(getAudioContext().currentTime + 0.01);
|
ref?.stop(getAudioContext().currentTime + 0.01);
|
||||||
trigRef.current = undefined;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue