From 096d896166684c197345610a5b9a5c77e2ff1819 Mon Sep 17 00:00:00 2001 From: Lars Date: Tue, 7 Apr 2026 12:39:41 +0200 Subject: [PATCH] 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. --- frontend/src/components/pilot/PilotKpiBoard.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/pilot/PilotKpiBoard.jsx b/frontend/src/components/pilot/PilotKpiBoard.jsx index 7496b13..e514ac5 100644 --- a/frontend/src/components/pilot/PilotKpiBoard.jsx +++ b/frontend/src/components/pilot/PilotKpiBoard.jsx @@ -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)