Skip to content

Commit

Permalink
count bug fixed in referral count
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj6939 committed Nov 21, 2022
1 parent fd19c53 commit 0851c0a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/components/participant/Action.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="accordion mt-3 mx-auto overflow-hidden" role="tablist" style="max-width: 600px"
@click="checkIfUserHasLoggedIn()">
<loading :active.sync="isLoading" :can-cancel="true" :is-full-page="fullPage"></loading>
<Profile v-if="userProfile" :user="userProfile" :count="count" />
<Profile v-if="userProfile" :user="userProfile" :userReferralCount="userReferralCount" />

<template v-for="(actionItem, index) in ActionSchema">
<component v-if="actionItem.type==='INFO_TEXT'" :is="CapitaliseString(actionItem.type)" :key="index"
Expand Down Expand Up @@ -87,8 +87,8 @@ export default {
required: true,
type: Object,
},
count: {
type: Number,
userReferralCount: {
type: Object,
},
authToken: {
required: true,
Expand Down
8 changes: 4 additions & 4 deletions src/components/participant/ActionInputs/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
<div class="text text-left">
{{ truncate1(referalLink,25) }}
<span @click="copy" class="copy"
v-if="count > 0"
v-if="userReferralCount.count > 0"
><i class="far fa-copy"></i
></span>
</div>
<small class="countCss" v-if="count > 0">Valid Upto {{count}} referrals</small>
<small class="countCss" v-if="userReferralCount.count > 0">Valid Upto {{userReferralCount.count}} referrals</small>
<small class="countCss" v-else>Referral link expired</small>
</b-col>
</b-row>
Expand Down Expand Up @@ -71,8 +71,8 @@ export default {
required: true,
type: Object,
},
count: {
type: Number,
userReferralCount: {
type: Object,
}
},
data() {
Expand Down
11 changes: 7 additions & 4 deletions src/views/participant/Event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<template>
<Action v-if="eventData.projectStatus"
:count="count"
:userReferralCount="userReferralCount"
:userProfile="Object.keys(userProfileData).length > 0 ? userProfileData : null"
:ActionSchema="eventActionsToShow" :authToken="authToken" :prizeData="prizeData"
@UserUpdateEvent="updateUserData" :themeData="eventData.orgData" />
Expand Down Expand Up @@ -73,7 +73,9 @@ export default {
authToken: "",
externalUserId:"",
userEventData: null,
count:0,
userReferralCount:{
count:0
},
userAuthData: null,
eventActionsToShow: [],
eventSlug: "",
Expand Down Expand Up @@ -327,8 +329,9 @@ export default {
this.userEventData = {
...res.data[0]
}
if(this.eventData.referralUsageLimit && this.userEventData.referralCount >= 0) {
this.count = this.eventData.referralUsageLimit - this.userEventData.referralCount
if(this.eventData.referralUsageLimit && this.userEventData.referralCount >= 0) {
this.userReferralCount.count = 0;
this.userReferralCount.count = this.eventData.referralUsageLimit - this.userEventData.referralCount
}
this.prizeData=this.eventData.actions.filter((x) => {
Expand Down

0 comments on commit 0851c0a

Please sign in to comment.