Skip to content

Commit

Permalink
Fix validator page without login
Browse files Browse the repository at this point in the history
  • Loading branch information
atmoner committed Nov 12, 2021
1 parent 7c25f83 commit 185731b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
28 changes: 16 additions & 12 deletions components/Modal/Restake.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,22 @@ export default {
return delegation ? Number(delegation.amount) : 0
},
transactionData() {
return {
type: lunieMessageTypes.RESTAKE,
from:
this.sourceValidator && this.sourceValidator.operatorAddress
? [this.sourceValidator.operatorAddress]
: null,
amount: {
amount: this.amount,
denom: this.stakingDenom,
},
to: [this.to],
delegator: [this.session.address],
if (this.session) {
return {
type: lunieMessageTypes.RESTAKE,
from:
this.sourceValidator && this.sourceValidator.operatorAddress
? [this.sourceValidator.operatorAddress]
: null,
amount: {
amount: this.amount,
denom: this.stakingDenom,
},
to: [this.to],
delegator: [this.session.address],
}
} else {
return {}
}
},
notifyMessage() {
Expand Down
13 changes: 12 additions & 1 deletion pages/validators/_address.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
</div>
</div>
<div class="action-buttons">
<CommonButton :value="`Delegate`" @click.native="openStakeModal" />
<CommonButton
:disabled="!isLogged"
:value="`Delegate`"
@click.native="openStakeModal"
/>
<CommonButton
:disabled="!delegation"
:value="`Redelegate`"
Expand Down Expand Up @@ -194,6 +198,13 @@ export default {
({ validator: { operatorAddress } }) => operatorAddress === this.address
)
},
isLogged() {
if (this.session) {
return true
} else {
return false
}
},
rewardsForValidator() {
console.log(this.rewards)
return this.rewards.filter(
Expand Down

0 comments on commit 185731b

Please sign in to comment.