From b6915bceff0020fb27aa1323ad6b7fa0e47bbdb3 Mon Sep 17 00:00:00 2001 From: Roger Gutierrez Date: Fri, 8 Nov 2024 11:31:07 -0600 Subject: [PATCH] fix: my kiva bugs --- src/components/MyKiva/BadgeTile.vue | 12 +++++++----- src/components/MyKiva/MyKivaStats.vue | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/MyKiva/BadgeTile.vue b/src/components/MyKiva/BadgeTile.vue index 861f12adc4..0d378fd277 100644 --- a/src/components/MyKiva/BadgeTile.vue +++ b/src/components/MyKiva/BadgeTile.vue @@ -107,11 +107,13 @@ const selectedTier = computed(() => { const tiers = []; tieredBadges.value.forEach(badge => { const tier = badge.achievementData?.tiers?.find(t => !t.completedDate); - tiers.push({ - badge, - totalProgressToAchievement: badge.achievementData.totalProgressToAchievement, - tier, - }); + if (tier) { + tiers.push({ + badge, + totalProgressToAchievement: badge.achievementData.totalProgressToAchievement, + tier, + }); + } }); const sorted = tiers.sort((a, b) => { const aDiff = a.tier.target - a.totalProgressToAchievement; diff --git a/src/components/MyKiva/MyKivaStats.vue b/src/components/MyKiva/MyKivaStats.vue index bba87b6ef0..3d24637f5e 100644 --- a/src/components/MyKiva/MyKivaStats.vue +++ b/src/components/MyKiva/MyKivaStats.vue @@ -104,7 +104,7 @@ onMounted(() => { apollo.query({ query: lendingStatsQuery }) .then(result => { livesTouched.value = result.data?.my?.lendingStats?.lentTo?.borrowers?.totalCount ?? 0; - totalAmountLent.value = +(result.data?.my?.userStats?.amount_of_loans ?? 0); + totalAmountLent.value = result.data?.my?.userStats?.amount_of_loans ?? 0; totalCountriesLentTo.value = result.data?.my?.statsPerCountry?.totalCount ?? 0; isLoaded.value = true; }).catch(e => {