From 2a54f863f4c13eed0456ff013b3dd1b86a30d5ee Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Mon, 2 Feb 2026 15:43:09 +0000 Subject: [PATCH] fix: broken loading screen --- frontend/src/pages/Stats.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/Stats.tsx b/frontend/src/pages/Stats.tsx index 8e2f512..b487204 100644 --- a/frontend/src/pages/Stats.tsx +++ b/frontend/src/pages/Stats.tsx @@ -37,6 +37,7 @@ const StatPage = () => { const getStats = () => { setError(""); + setLoading(true); Promise.all([ axios.get("http://localhost:5000/stats/time"), @@ -78,7 +79,8 @@ const StatPage = () => { ); }) - .catch((e) => setError("Failed to load statistics: " + String(e))); + .catch((e) => setError("Failed to load statistics: " + String(e))) + .finally(() => setLoading(false)); }; const onSearch = () => { @@ -105,9 +107,7 @@ const StatPage = () => { }; useEffect(() => { - setLoading(true); getStats(); - setLoading(false); }, []) if (loading) return

Loading insights…

;