diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index 536367d..586805c 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -247,6 +247,12 @@ export default function Dashboard() { setNutrition(n); setActivities(a) setInsights(Array.isArray(ins)?ins:[]) setLoading(false) + }).catch(err => { + console.error('Dashboard load failed:', err) + // Set empty data on error so UI can still render + setStats(null); setWeights([]); setCalipers([]); setCircs([]) + setNutrition([]); setActivities([]); setInsights([]) + setLoading(false) }) const runPipeline = async () => { @@ -260,7 +266,12 @@ export default function Dashboard() { } finally { setPipelineLoading(false) } } - useEffect(()=>{ load() },[]) + useEffect(()=>{ + console.log('[Dashboard] Component mounted, loading data...') + load() + },[]) + + console.log('[Dashboard] Rendering, loading=', loading, 'activeProfile=', activeProfile?.name) if (loading) return
@@ -304,6 +315,8 @@ export default function Dashboard() { const hasAnyData = latestW||latestCal||nutrition.length>0 + console.log('[Dashboard] hasAnyData=', hasAnyData, 'latestW=', !!latestW, 'latestCal=', !!latestCal, 'nutrition.length=', nutrition.length) + return (
{/* Header greeting */} @@ -318,10 +331,10 @@ export default function Dashboard() {
{/* Email Verification Banner */} - + {activeProfile && } {/* Trial Banner */} - + {activeProfile && } {!hasAnyData && (