diff --git a/vehicle-data-platform/apps/web/src/App.tsx b/vehicle-data-platform/apps/web/src/App.tsx index 133def83..3680cfb2 100644 --- a/vehicle-data-platform/apps/web/src/App.tsx +++ b/vehicle-data-platform/apps/web/src/App.tsx @@ -15,17 +15,25 @@ export default function App() { const [activeVin, setActiveVin] = useState('LB9A32A24R0LS1426'); const [linkIssueCount, setLinkIssueCount] = useState(null); - const refreshOpsHealth = useCallback(() => { + const refreshOpsHealth = useCallback((showError = true) => { return api.opsHealth() .then((health) => { setLinkIssueCount(health.linkHealth.filter((item) => item.status !== 'ok').length); return health; }) - .catch((error: Error) => Toast.error(error.message)); + .catch((error: Error) => { + if (showError) { + Toast.error(error.message); + } + }); }, []); useEffect(() => { refreshOpsHealth(); + const timer = window.setInterval(() => { + refreshOpsHealth(false); + }, 60000); + return () => window.clearInterval(timer); }, [refreshOpsHealth]); const openVehicle = (vin: string) => {