Skip to content

Commit

Permalink
Fix Uptime
Browse files Browse the repository at this point in the history
  • Loading branch information
atmoner committed Nov 11, 2021
1 parent c404a99 commit 194839c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
11 changes: 10 additions & 1 deletion components/staking/ValidatorRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
{{ validator.votingPower | bigFigureOrPercent }}
</td>
<td class="cell">
{{ validator.uptimePercentage | bigFigureOrPercent }}
<!-- {{ validator.uptimePercentage | bigFigureOrPercent }} -->
{{ checkValidatorUptime() }}
</td>
<td class="cell">
{{ validator.commission | bigFigureOrPercent }}
Expand Down Expand Up @@ -118,6 +119,14 @@ export default {
)
return stakingDenomRewards.length > 0 ? stakingDenomRewards[0].amount : 0
},
checkValidatorUptime() {
console.log(this.validator.status)
if (this.validator.status === 'INACTIVE') {
return '0%'
} else {
return '100%'
}
},
},
}
</script>
Expand Down
10 changes: 9 additions & 1 deletion pages/validators/_address.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<section class="row">
<div>
<h4>Uptime</h4>
<span>{{ isBlankField(validator.uptimePercentage, percent) }}</span>
<span>{{ checkValidatorUptime() }}</span>
</div>
<div>
<h4>Validator Since</h4>
Expand Down Expand Up @@ -231,6 +231,14 @@ export default {
percent,
fromNow,
noBlanks,
checkValidatorUptime() {
console.log(this.validator.status)
if (this.validator.status === 'INACTIVE') {
return '0%'
} else {
return '100%'
}
},
/* istanbul ignore next */
openStakeModal() {
this.$refs.StakeModal.open()
Expand Down

0 comments on commit 194839c

Please sign in to comment.