fix: broken loading screen

This commit is contained in:
2026-02-02 15:43:09 +00:00
parent 291b6ed2aa
commit 2a54f863f4

View File

@@ -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 <p className="p-6">Loading insights</p>;