Skip to content

Commit

Permalink
fix: check completed date when showing badge last tier as completed
Browse files Browse the repository at this point in the history
  • Loading branch information
dyersituations committed Dec 17, 2024
1 parent 0fffe4a commit 31999da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/MyKiva/BadgesSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const visibleBadges = computed(() => {
const getBadgeStatus = badge => {
const activeTier = getActiveTierData(badge);
if (activeTier?.level === badge?.achievementData?.tiers?.length) {
if (activeTier?.level === badge?.achievementData?.tiers?.length && activeTier?.completedDate) {
return BADGE_COMPLETED;
}
return BADGE_IN_PROGRESS;
Expand Down
23 changes: 12 additions & 11 deletions src/composables/useBadgeData.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,18 @@ export default function useBadgeData() {
const currentTier = badge.achievementData.tiers[levelIndex];
/**
* {
* "id": "",
* "challengeName": "",
* "level": 1,
* "levelName": "",
* "shareFact": "",
* "shareFactFootnote": "",
* "shareFactUrl": "",
* "imageUrl": "",
* "target": 1,
* "tierStatement": "",
* "learnMoreURL": ""
* "id": string,
* "challengeName": string,
* "level": number,
* "levelName": string,
* "shareFact": string,
* "shareFactFootnote": string,
* "shareFactUrl": string,
* "imageUrl": string,
* "target": number,
* "tierStatement": string,
* "learnMoreURL": string,
* "completedDate": string,
* }
*/
return {
Expand Down

0 comments on commit 31999da

Please sign in to comment.