Signed-off-by: ale <ale@manalejandro.com>
This commit is contained in:
ale 2025-05-19 16:18:29 +02:00
parent bf0ddd53b1
commit c233fcc017
Signed by: ale
GPG Key ID: 244A9C4DAB1C0C81

View File

@ -33,12 +33,12 @@ const App = () => {
if (audioElmRef.current) { if (audioElmRef.current) {
await audioElmRef.current.play() await audioElmRef.current.play()
} }
}), }, [audioElmRef]),
pause = useCallback(async () => { pause = useCallback(async () => {
if (audioElmRef.current) { if (audioElmRef.current) {
await audioElmRef.current.pause() await audioElmRef.current.pause()
} }
}), }, [audioElmRef]),
loadData = () => { loadData = () => {
fetch('/stream.json').then(response => response.json()).then(json => { fetch('/stream.json').then(response => response.json()).then(json => {
setJson(json) setJson(json)
@ -58,6 +58,8 @@ const App = () => {
setMaxListeners(listeners[i].textContent) setMaxListeners(listeners[i].textContent)
} }
} }
}).catch(err => {
console.error('Error fetching data: ' + err.message)
}) })
} }
useEffect(() => { useEffect(() => {