diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index d9b634f71..220778e22 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -150,9 +150,13 @@ export default function App() { useEffect(() => { // Timer to call getHealth every 5 seconds const timer = setInterval(() => { - getHealth().catch((e) => { - setFetchError(true); - }); + getHealth() + .then(() => { + if (fetchError) setFetchError(false); + }) + .catch(() => { + setFetchError(true); + }); }, 5000); // Clean up the timer on component unmount