Update src/optionsMenu/helpers/VUMeter.tsx

Co-authored-by: Marks Polakovs <github@markspolakovs.me>
This commit is contained in:
Matthew Stratford 2021-01-30 19:39:14 +00:00 committed by GitHub
parent 76eedd365b
commit db4335a543
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,9 @@ export function VUMeter(props: VUMeterProps) {
setPeakR(result[1]);
}
setTimeout((current = rafRef.current, a = animate) => {
if (isMounted) current = requestAnimationFrame(a);
if (isMounted) {
current = requestAnimationFrame(a);
}
}, 1000 / FPS);
}
};