Fix "rake ci"
This commit is contained in:
parent
4a362b7db8
commit
9641ea2f57
1 changed files with 9 additions and 15 deletions
|
@ -13,28 +13,22 @@ type Props = {
|
||||||
onComplete: (surah: Surah, ayah: Ayah) => void;
|
onComplete: (surah: Surah, ayah: Ayah) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function Timer({
|
export function Timer({ locale, surah, ayah, isPaused, audioStatus, onComplete }: Props) {
|
||||||
locale,
|
|
||||||
surah,
|
|
||||||
ayah,
|
|
||||||
isPaused,
|
|
||||||
audioStatus,
|
|
||||||
onComplete,
|
|
||||||
}: Props) {
|
|
||||||
const [ms, setMs] = useState<number | null>(null);
|
const [ms, setMs] = useState<number | null>(null);
|
||||||
const isStalled = audioStatus === "wait";
|
const isStalled = audioStatus === "wait";
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!ayah)
|
if (ayah) {
|
||||||
return
|
|
||||||
setMs(ayah.ms);
|
setMs(ayah.ms);
|
||||||
|
}
|
||||||
}, [ayah?.id]);
|
}, [ayah?.id]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!ayah)
|
if (!ayah) {
|
||||||
return
|
return;
|
||||||
if (audioStatus === "play")
|
} else if (audioStatus === "play") {
|
||||||
setMs(ayah.ms)
|
setMs(ayah.ms);
|
||||||
|
}
|
||||||
}, [audioStatus]);
|
}, [audioStatus]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
Loading…
Reference in a new issue