Skip to content

Commit

Permalink
fix(lint): useAdio hook tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
onetdev committed Aug 30, 2024
1 parent ab9f1e8 commit d1adcb0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/hooks/useAudio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit d1adcb0

Please sign in to comment.