From 9e4d6fa715ed89ab3a06096fd1faa312c6d3d726 Mon Sep 17 00:00:00 2001 From: Lars Date: Sun, 22 Mar 2026 08:33:28 +0100 Subject: [PATCH] fix: make sleep stats optional to prevent page crash If stats endpoint fails, page will still load with empty stats. This prevents 500 errors from blocking the entire sleep page. Co-Authored-By: Claude Opus 4.6 --- frontend/src/pages/SleepPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/SleepPage.jsx b/frontend/src/pages/SleepPage.jsx index 41cccd7..a17bff8 100644 --- a/frontend/src/pages/SleepPage.jsx +++ b/frontend/src/pages/SleepPage.jsx @@ -44,7 +44,7 @@ export default function SleepPage() { setLoading(true) Promise.all([ api.listSleep(30), - api.getSleepStats(7) + api.getSleepStats(7).catch(() => null) // Stats optional - don't fail if error ]).then(([sleepData, statsData]) => { setSleep(sleepData) setStats(statsData)