out promises

Signed-off-by: ale <ale@manalejandro.com>
This commit is contained in:
ale 2025-05-19 16:54:12 +02:00
parent 7e8467faae
commit 479c394c50
Signed by: ale
GPG Key ID: 244A9C4DAB1C0C81

View File

@ -32,20 +32,12 @@ const App = () => {
},
play = () => {
if (audioElmRef.current) {
audioElmRef.current.play().then(() => {
setPlayPause(true)
}).catch(err => {
console.error('Error playing audio: ' + err.message)
})
audioElmRef.current.play()
}
},
pause = () => {
if (audioElmRef.current) {
audioElmRef.current.pause().then(() => {
setPlayPause(false)
}).catch(err => {
console.error('Error pausing audio: ' + err.message)
})
audioElmRef.current.pause()
}
},
loadData = () => {