!0 evaluates as true, returning early for a case we didn't expect

The if guard in this commit is aimed at catching null / undefined.
This commit is contained in:
0x1eef 2024-05-02 05:31:46 -03:00
parent 1d06b50300
commit adfe95103e

View file

@ -32,7 +32,7 @@ export function Timer({
}, [ayah?.id]); }, [ayah?.id]);
useEffect(() => { useEffect(() => {
if (!ayah || !ms) { if (!ayah || typeof ms !== "number") {
return; return;
} else if (isStalled || isPaused) { } else if (isStalled || isPaused) {
/* no-op */ /* no-op */