Skip to content

Commit

Permalink
fix: my kiva stats bug (#5656)
Browse files Browse the repository at this point in the history
* feat: my kiva header badge tile

* fix: my kiva stats fixed
  • Loading branch information
roger-in-kiva authored Nov 7, 2024
1 parent 874d0bb commit e0c9d65
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/components/MyKiva/MyKivaStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,21 @@ const totalAmountLent = ref(0);
const totalCountriesLentTo = ref(0);
const completedAchievements = computed(() => {
return userAchievements.value.filter(
achievement => achievement.status === 'COMPLETE' // Update this status field when having from backend
);
const achievements = [];
userAchievements.value.forEach(achievement => {
if (achievement.milestoneProgress?.[0]?.milestoneStatus === 'COMPLETE') {
achievements.push(achievement);
}
if (achievement.tiers?.length) {
achievement.tiers.forEach(tier => {
if (tier.completedDate) {
achievements.push(achievement);
}
});
}
});
return achievements;
});
const completedAchievementsNumber = computed(() => {
Expand Down

0 comments on commit e0c9d65

Please sign in to comment.