minor tweak at onEnd

This commit is contained in:
Reinaldo Neto 2023-10-24 00:07:00 -03:00
parent 3805bc9c32
commit 6b6904ec63
1 changed files with 6 additions and 8 deletions

View File

@ -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
}
}
};