Include planning as active projects and award achievements on dashboard load
cgen-fc66386207d4407e9977fc3b529c4264
This commit is contained in:
parent
38367daebe
commit
22b8009ceb
1 changed files with 9 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue