fix: Correct syntax error in PilotKpiBoard component
- Fixed a syntax error in the recentNutr filter function by adding a closing parenthesis. - Ensured proper calculation of kcal based on recent nutrition data.
This commit is contained in:
parent
de99856a28
commit
096d896166
|
|
@ -44,7 +44,7 @@ export default function PilotKpiBoard({ refreshTick = 0, kcalWindowDays = KPI_KC
|
|||
const latestCal = Array.isArray(calipers) && calipers[0]?.body_fat_pct != null ? calipers[0] : null
|
||||
const recentNutr = (nutrition || []).filter(
|
||||
(n) => n.date >= dayjs().subtract(kcalWindowDays, 'day').format('YYYY-MM-DD'),
|
||||
})
|
||||
)
|
||||
const kcal =
|
||||
recentNutr.length > 0
|
||||
? Math.round(recentNutr.reduce((s, n) => s + (n.kcal || 0), 0) / recentNutr.length)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user