Fix sleep score parsing, dashboard body battery, segment direction
- Garmin sync: read sleepScores from dailySleepDTO (Garmin nests it there), so sleep score is actually stored instead of always null - Dashboard: pass YYYY-MM-DD to the intraday endpoint (was a full ISO timestamp), so the body-battery tile populates - Segment matching: follow the segment in its created direction with a path-length sanity check, so out-and-back routes no longer match an early start pass to a late finish (the >1h bogus segment times) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -152,7 +152,7 @@ export default function DashboardPage() {
|
||||
const rows = [...(recentHealth || [])].sort((a, b) => new Date(b.date) - new Date(a.date))
|
||||
const pick = f => rows.find(d => d[f] != null)?.[f] ?? null
|
||||
return {
|
||||
date: rows[0]?.date ?? null,
|
||||
date: rows[0]?.date ? rows[0].date.slice(0, 10) : null, // intraday endpoint wants YYYY-MM-DD
|
||||
resting_hr: pick('resting_hr'),
|
||||
sleep_duration_s: pick('sleep_duration_s'),
|
||||
hrv_nightly_avg: pick('hrv_nightly_avg'),
|
||||
|
||||
Reference in New Issue
Block a user