From 22b8009ceb813899932509385100480a2754138a Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 27 Sep 2025 22:00:51 +0000 Subject: [PATCH] Include planning as active projects and award achievements on dashboard load cgen-fc66386207d4407e9977fc3b529c4264 --- client/pages/Dashboard.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/pages/Dashboard.tsx b/client/pages/Dashboard.tsx index 1d609263..81e7a66b 100644 --- a/client/pages/Dashboard.tsx +++ b/client/pages/Dashboard.tsx @@ -103,6 +103,13 @@ export default function Dashboard() { setProjects([]); } + // Check and award project-related achievements, then load achievements + try { + await aethexAchievementService.checkAndAwardProjectAchievements(user!.id); + } catch (e) { + console.warn("checkAndAwardProjectAchievements failed:", e); + } + // Load user's achievements with error handling let userAchievements = []; try { @@ -115,9 +122,9 @@ export default function Dashboard() { setAchievements([]); } - // Calculate stats + // Calculate stats (treat planning and in_progress as active) const activeCount = userProjects.filter( - (p) => p.status === "in_progress", + (p) => p.status === "in_progress" || p.status === "planning", ).length; const completedCount = userProjects.filter( (p) => p.status === "completed",