catch
Signed-off-by: ale <ale@manalejandro.com>
This commit is contained in:
parent
bf0ddd53b1
commit
c233fcc017
@ -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(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user