Update Timer/index.tsx

This commit is contained in:
0x1eef 2024-06-22 14:38:04 -03:00
parent f939b2cc41
commit 4327e81a3a

View file

@ -26,7 +26,7 @@ export function Timer({
const [ms, setMs] = useState<number | null>(null);
const isStalled = audioStatus === "wait";
const getMs = () => {
function getMs() {
const fallback =
audioStatus === null || audioStatus === "pause" || isNaN(audio.duration);
if (fallback) {
@ -36,7 +36,7 @@ export function Timer({
console.info("timer: length determined by HTMLAudioElement");
return audio.duration * 1000;
}
};
}
useEffect(() => {
if (ayah) {