Skip to content

Commit

Permalink
Merge pull request #1487 from hypersign-protocol/v5.6.0
Browse files Browse the repository at this point in the history
V5.6.0
  • Loading branch information
Vishwas1 authored Jul 22, 2022
2 parents d648599 + ab4ce05 commit 67f7f7c
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 38 deletions.
19 changes: 10 additions & 9 deletions src/components/participant/Action.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div class="accordion mt-3 mx-auto overflow-hidden" role="tablist" style="max-width: 600px" @click="checkIfUserHasLoggedIn()">
<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" />

Expand All @@ -14,9 +15,9 @@

<template v-for="(actionItem, index) in ActionSchema">

<component v-if="actionItem.type!=='INFO_TEXT'" :is="CapitaliseString(actionItem.type)" :key="index"
:idValue="index" :data="actionItem" :authToken="authToken" :done="actionItem.isDone"
@input="updateUserInfo(actionItem, $event)" :themeData="themeData">
<component v-if="(actionItem.type !== 'INFO_TEXT') && (actionItem.type !=='PRIZE_CARD') "
:is="CapitaliseString(actionItem.type)" :key="index" :idValue="index" :data="actionItem" :authToken="authToken"
:done="actionItem.isDone" @input="updateUserInfo(actionItem, $event)">
</component>
</template>
</div>
Expand Down Expand Up @@ -165,8 +166,10 @@ export default {
computed: {
// eslint-disable-next-line vue/return-in-computed-property
isPrizedata() {
if (this.prizeData.length > 0) {
if (this.prizeData && this.prizeData.length > 0) {
return true;
} else {
return false;
}
},
},
Expand Down Expand Up @@ -205,11 +208,9 @@ export default {
};
const ts=Math.floor(Date.now() / 1000);
const endPoint='api/v1/investor'
const signature=crypto.createHmac('sha256',config.investor_sign_key)
const signature= crypto.createHmac('sha256',config.investor_sign_key)
signature.update(ts+endPoint+JSON.stringify(body))
const sig=signature.digest('hex')
const sig= signature.digest('hex')
let url = `${this.$config.studioServer.BASE_URL}api/v1/investor?rcToken=${this.RecaptchaToken}`;
if (this.$route.query.referrer && this.$route.query.referrer != "") {
url += `&referrer=${this.$route.query.referrer}`;
Expand Down
32 changes: 11 additions & 21 deletions src/components/participant/ActionInputs/PrizeCard.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<template>
<b-card no-body class="action-wrap">
<b-card-header
:class="visible ? null : 'collapsed'"
:aria-expanded="visible ? 'true' : 'false'"
aria-controls="profile"
@click="visible = !visible"

>
<b-card no-body class="action-wrap">
<b-card-header :class="visible ? null : 'collapsed'" :aria-expanded="visible ? 'true' : 'false'"
aria-controls="profile" @click="visible = !visible">
<b-row>
<b-col cols="1" sm="1" md="1">
<img src="../../../assets/gift.svg" height="25px" />
Expand All @@ -16,16 +11,11 @@
</b-col>
</b-row>
</b-card-header>
<b-collapse id="profile" v-model="visible" >
<b-collapse id="profile" v-model="visible">
<b-card-body class="user-details">
<table
v-if="prizeData.length"
class="table table-bordered"
style="background: #ffff
<table v-if="prizeData && prizeData.length" class="table table-bordered" style="background: #ffff
table-layout:fixed;
word-wrap:break-word;"

>
word-wrap:break-word;">
<thead class="thead-light">
<tr>
<th>Prize Name</th>
Expand All @@ -35,14 +25,14 @@
</thead>
<tbody>
<tr v-for="row in prizeData" :key="row._id">
<th class="wrapword" >
{{row.title}}
<th class="wrapword">
{{row.title}}
</th>
<td class="wrapword">
{{ JSON.parse(row.value).winners }}
</td>
{{ JSON.parse(row.value).winners }}
</td>
<td class="wrapword">
{{ JSON.parse(row.value).prizeValue }}
{{ JSON.parse(row.value).prizeValue }}
</td>
</tr>
</tbody>
Expand Down
13 changes: 13 additions & 0 deletions src/components/participant/ActionInputs/TelegramJoin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,19 @@ computed:{
},
};
},
updated() {
try {
if (this.data.value) {
if (this.tg.sourceScreenName == "" || this.tg.targetScreenName == ""){
const tg = JSON.parse(this.data.value);
this.tg = { ...tg };
}
}
} catch (e) {
this.tg.sourceScreenName = this.data.value;
}
},
async mounted() {
try {
if (this.data.value) {
Expand Down
9 changes: 5 additions & 4 deletions src/components/participant/ActionInputs/TwitterFollow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ computed:{
},
updated() {
try {
if (this.data.value && this.twitter.sourceScreenName == "") {
const twitter = JSON.parse(this.data.value);
this.twitter = { ...twitter };
if (this.data.value ) {
if (this.twitter.sourceScreenName == "" || this.twitter.targetScreenName == ""){
const twitter = JSON.parse(this.data.value);
this.twitter = { ...twitter };
}
}
} catch (e) {
console.error(e)
this.twitter.sourceScreenName = this.data.value;
}
},
Expand Down
6 changes: 3 additions & 3 deletions src/views/participant/Event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export default {
this.authToken = authToken;
eventBus.$emit('getAuthToken', authToken)
await this.fetchUserDetails();
this.fetchUserInfoOnLogin();
await this.fetchUserInfoOnLogin();
}catch(e){
this.notifyErr(Messages.EVENT.ERROR_OCCURED + e.message);
}
Expand Down Expand Up @@ -299,12 +299,12 @@ export default {
header: headers,
method: "GET",
})
if(res.data.length === 0){
if (res.data == "undefined" || !res.data || res.data.length === 0){
// a user can participate in event
// Participate in event
try{
const hypersignAuthAction = this.eventData.actions.find(x => x.type == "HYPERSIGN_AUTH")
if(hypersignAuthAction){
eventBus.$emit('UpdateUserInfoFromEvent', { actionItem: hypersignAuthAction, value: "Authorized"});
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/participant/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export default {
this.authToken = authToken;
eventBus.$emit("getAuthToken", authToken);
await this.fetchUserDetails();
this.fetchUserEventData();
await this.fetchUserEventData();
} catch (e) {
this.notifyErr(Messages.EVENT.ERROR_OCCURED + e.message);
}
Expand Down

0 comments on commit 67f7f7c

Please sign in to comment.