From 6b6904ec63ca59d509b1510a3f875d19d2dcc037 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto Date: Tue, 24 Oct 2023 00:07:00 -0300 Subject: [PATCH] minor tweak at onEnd --- app/containers/AudioPlayer/index.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/containers/AudioPlayer/index.tsx b/app/containers/AudioPlayer/index.tsx index 532b4a6b8..331d05d41 100644 --- a/app/containers/AudioPlayer/index.tsx +++ b/app/containers/AudioPlayer/index.tsx @@ -69,14 +69,12 @@ const AudioPlayer = ({ }; const onEnd = (data: AVPlaybackStatus) => { - if (data.isLoaded) { - if (data.didJustFinish) { - try { - setPaused(true); - currentTime.value = 0; - } catch { - // do nothing - } + if (data.isLoaded && data.didJustFinish) { + try { + setPaused(true); + currentTime.value = 0; + } catch { + // do nothing } } };