Final Feature 9c #10
|
|
@ -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 <div className="empty-state"><div className="spinner"/></div>
|
||||
|
||||
|
|
@ -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 (
|
||||
<div>
|
||||
{/* Header greeting */}
|
||||
|
|
@ -318,10 +331,10 @@ export default function Dashboard() {
|
|||
</div>
|
||||
|
||||
{/* Email Verification Banner */}
|
||||
<EmailVerificationBanner profile={activeProfile}/>
|
||||
{activeProfile && <EmailVerificationBanner profile={activeProfile}/>}
|
||||
|
||||
{/* Trial Banner */}
|
||||
<TrialBanner profile={activeProfile}/>
|
||||
{activeProfile && <TrialBanner profile={activeProfile}/>}
|
||||
|
||||
{!hasAnyData && (
|
||||
<div className="empty-state">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user