From e2414fbb8f4e9e33efdf486f583e47d9215b012a Mon Sep 17 00:00:00 2001
From: Christian Bedon
Date: Mon, 25 Nov 2024 16:44:41 -0500
Subject: [PATCH] fix: badges loading indicator
---
src/pages/Portfolio/LendingStats/BadgesSection.vue | 10 +++-------
src/pages/Portfolio/LendingStats/LendingStatsPage.vue | 8 +++-----
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/src/pages/Portfolio/LendingStats/BadgesSection.vue b/src/pages/Portfolio/LendingStats/BadgesSection.vue
index 67745f107c..15256aa850 100644
--- a/src/pages/Portfolio/LendingStats/BadgesSection.vue
+++ b/src/pages/Portfolio/LendingStats/BadgesSection.vue
@@ -38,10 +38,9 @@ export default {
type: Array,
default: () => []
},
- /* total number of possible badges */
- totalPossibleBadges: {
- type: Number,
- default: 0
+ isLoading: {
+ type: Boolean,
+ default: false
},
},
components: {
@@ -52,9 +51,6 @@ export default {
badgesObtained() {
return this.completedAchievements.length ?? 0;
},
- isLoading() {
- return this.totalPossibleBadges === 0;
- },
},
};
diff --git a/src/pages/Portfolio/LendingStats/LendingStatsPage.vue b/src/pages/Portfolio/LendingStats/LendingStatsPage.vue
index 8aee83472a..cfa6900d1a 100644
--- a/src/pages/Portfolio/LendingStats/LendingStatsPage.vue
+++ b/src/pages/Portfolio/LendingStats/LendingStatsPage.vue
@@ -23,7 +23,7 @@
@@ -178,10 +178,8 @@ export default {
return completedBadgesArr;
},
- totalPossibleBadges() {
- return this.badgesData.reduce((acc, badge) => {
- return acc + (badge?.contentfulData?.length ?? 0);
- }, 0);
+ badgesLoading() {
+ return !this.badgesData.length;
}
},
methods: {