Skip to content

Commit

Permalink
fix: don't how badges without new tier achieved, only show MyKiva TY …
Browse files Browse the repository at this point in the history
…when loans checked out
  • Loading branch information
dyersituations committed Dec 4, 2024
1 parent 2f91c61 commit 32c8b3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/graphql/query/postCheckoutAchievements.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ query PostCheckoutAchievements($loanIds: [Int!]!) {
overallProgress {
id
achievementId
preCheckoutTier
postCheckoutTier
}
}
}
4 changes: 3 additions & 1 deletion src/pages/Thanks/ThanksPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ export default {
this.optedIn = data?.my?.communicationSettings?.lenderNews || this.$route.query?.optedIn === 'true';
// MyKiva Badges Experiment
if (!this.landedOnUSLoan && !this.printableKivaCards.length) {
if (!this.landedOnUSLoan && !this.printableKivaCards.length && hasLentBefore) {
this.myKivaEnabled = getIsMyKivaEnabled(
this.apollo,
this.$kvTrackEvent,
Expand All @@ -641,6 +641,8 @@ export default {
variables: { loanIds: getLoanIds(this.loans) },
});
this.badgesAchieved = response?.postCheckoutAchievements?.overallProgress ?? [];
// Don't show badges without a new tier achieved
this.badgesAchieved = this.badgesAchieved.filter(b => b.preCheckoutTier !== b.postCheckoutTier);
// MyKiva view only shown if user is not opted-in or checkout achieved badges
this.myKivaEnabled = !this.optedIn || this.badgesAchieved.length > 0;
} catch (e) {
Expand Down

0 comments on commit 32c8b3c

Please sign in to comment.