Skip to content

Commit

Permalink
fix: level replaced with level name
Browse files Browse the repository at this point in the history
  • Loading branch information
roger-in-kiva committed Nov 20, 2024
1 parent d06e8ea commit 5021fa6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/MyKiva/BadgeTile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,14 @@ const selectedTier = computed(() => {
const tiers = [];
tieredBadges.value.forEach(badge => {
const tier = badge.achievementData?.tiers?.find(t => !t.completedDate);
const tierBadgeData = getTierBadgeDataByLevel(badge, tier.level);
const levelName = tierBadgeData?.contentfulData?.levelName ?? '';
if (tier) {
tiers.push({
badge,
totalProgressToAchievement: badge.achievementData.totalProgressToAchievement,
tier,
levelName,
});
}
});
Expand All @@ -133,7 +136,7 @@ const selectedTier = computed(() => {
const badgeName = computed(() => selectedTier?.value?.badge?.challengeName ?? '');
const tileTitle = computed(() => {
const tierLevel = selectedTier?.value?.tier?.level ?? '';
const tierLevel = selectedTier?.value?.levelName ?? '';
return `${badgeName.value} (level ${tierLevel})`;
});
Expand Down

0 comments on commit 5021fa6

Please sign in to comment.