From 6a9f1e41a4dbeaaf5c620140aad91d3fc23cdcfe Mon Sep 17 00:00:00 2001 From: Timothy Date: Sat, 4 Jul 2026 20:55:38 +0200 Subject: [PATCH] fix(web): satisfy dashboard lint checks refs #109 --- web/src/App.tsx | 3 +-- web/src/api/dashboard.ts | 13 ++++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index a6ccb98e1..dc042174f 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -50,8 +50,7 @@ import { useDashboardVersionQuery, type DashboardChannel, type DashboardChannelState, - type DashboardHealthQueryState, - type DashboardVersionQueryState + type DashboardHealthQueryState } from './api'; import { applyDesignSystemTheme, diff --git a/web/src/api/dashboard.ts b/web/src/api/dashboard.ts index 539085218..4ea56cc3f 100644 --- a/web/src/api/dashboard.ts +++ b/web/src/api/dashboard.ts @@ -94,17 +94,20 @@ export function useDashboardHealthQuery(): DashboardHealthQueryState { status: 'loading' }); - const refresh = useCallback(() => { - setState({ checks: null, error: null, status: 'loading' }); - + const loadHealth = useCallback(() => { getDashboardHealth() .then((checks) => setState({ checks, error: null, status: 'success' })) .catch((error: unknown) => setState({ checks: null, error: messageFromError(error), status: 'error' })); }, []); + const refresh = useCallback(() => { + setState({ checks: null, error: null, status: 'loading' }); + loadHealth(); + }, [loadHealth]); + useEffect(() => { - refresh(); - }, [refresh]); + loadHealth(); + }, [loadHealth]); if (state.status === 'success') { return { checks: state.checks, error: null, refresh, status: 'success' };