From c233fcc017daa91c9eae018d89202f339fdcf256 Mon Sep 17 00:00:00 2001 From: ale Date: Mon, 19 May 2025 16:18:29 +0200 Subject: [PATCH] catch Signed-off-by: ale --- src/App.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index b71a010..e2d9425 100644 --- a/src/App.js +++ b/src/App.js @@ -33,12 +33,12 @@ const App = () => { if (audioElmRef.current) { await audioElmRef.current.play() } - }), + }, [audioElmRef]), pause = useCallback(async () => { if (audioElmRef.current) { await audioElmRef.current.pause() } - }), + }, [audioElmRef]), loadData = () => { fetch('/stream.json').then(response => response.json()).then(json => { setJson(json) @@ -58,6 +58,8 @@ const App = () => { setMaxListeners(listeners[i].textContent) } } + }).catch(err => { + console.error('Error fetching data: ' + err.message) }) } useEffect(() => {