From d1adcb0db7881a8d91375e1b5183b7fd6d0dcee0 Mon Sep 17 00:00:00 2001 From: Konrad Koller Date: Fri, 30 Aug 2024 22:01:29 +0200 Subject: [PATCH] fix(lint): useAdio hook tweaks --- src/hooks/useAudio.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hooks/useAudio.ts b/src/hooks/useAudio.ts index e72951d..2668419 100644 --- a/src/hooks/useAudio.ts +++ b/src/hooks/useAudio.ts @@ -15,7 +15,11 @@ const useAudio = (url: string) => { const play = () => setPlaying(true); useEffect(() => { - playing ? audio.current?.play() : audio.current?.pause(); + if (playing) { + audio.current?.play(); + } else { + audio.current?.pause(); + } }, [audio, playing]); useEffect(() => {