From 9641ea2f574968892bddca24dc2df264b0145d2e Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 24 May 2024 14:07:52 -0300 Subject: [PATCH] Fix "rake ci" --- src/js/components/SurahStream/Timer.tsx | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/js/components/SurahStream/Timer.tsx b/src/js/components/SurahStream/Timer.tsx index 5479d69..7d6a72f 100644 --- a/src/js/components/SurahStream/Timer.tsx +++ b/src/js/components/SurahStream/Timer.tsx @@ -13,28 +13,22 @@ type Props = { onComplete: (surah: Surah, ayah: Ayah) => void; }; -export function Timer({ - locale, - surah, - ayah, - isPaused, - audioStatus, - onComplete, -}: Props) { +export function Timer({ locale, surah, ayah, isPaused, audioStatus, onComplete }: Props) { const [ms, setMs] = useState(null); const isStalled = audioStatus === "wait"; useEffect(() => { - if (!ayah) - return - setMs(ayah.ms); + if (ayah) { + setMs(ayah.ms); + } }, [ayah?.id]); useEffect(() => { - if (!ayah) - return - if (audioStatus === "play") - setMs(ayah.ms) + if (!ayah) { + return; + } else if (audioStatus === "play") { + setMs(ayah.ms); + } }, [audioStatus]); useEffect(() => {