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 = () => { play = () => {
if (audioElmRef.current) { if (audioElmRef.current) {
audioElmRef.current.play().then(() => { audioElmRef.current.play()
setPlayPause(true)
}).catch(err => {
console.error('Error playing audio: ' + err.message)
})
} }
}, },
pause = () => { pause = () => {
if (audioElmRef.current) { if (audioElmRef.current) {
audioElmRef.current.pause().then(() => { audioElmRef.current.pause()
setPlayPause(false)
}).catch(err => {
console.error('Error pausing audio: ' + err.message)
})
} }
}, },
loadData = () => { loadData = () => {