Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Commit

Permalink
fix: update more status code changes (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig authored and kwunyeung committed Jan 20, 2021
1 parent 356b1d6 commit 4a5863b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions imports/ui/components/AccountTooltip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ export default class AccountTooltip extends Account{
return
let validator = this.state.validator;
let moniker = (validator.description && validator.description.moniker) || validator.address;
let isActive = validator.status == 2 && !validator.jailed;
let isActive = validator.status == 3 && !validator.jailed;

return <UncontrolledPopover className='validator-popover' trigger="hover" placement="right" target={this.ref} key={this.ref}>
<Card className='validator-popover-card' body outline color="danger">
<PopoverHeader>
<CardTitle className='d-flex justify-content-center'>
<h4 className="moniker text-primary">{moniker}</h4>
<h4 className="moniker text-primary">{moniker}</h4>
</CardTitle>
</PopoverHeader>
<PopoverBody>
</PopoverHeader>
<PopoverBody>
<CardText className="voting-power data">
<i className="material-icons">power </i>
{validator.voting_power?numbro(validator.voting_power).format('0,0'):0}
Expand All @@ -70,22 +70,22 @@ export default class AccountTooltip extends Account{
{(isActive)?<CardText className="commission data">
<i className="material-icons">call_split </i>{ (validator.commission.commission_rates)?
numbro(validator.commission.commission_rates.rate).format('0.00%') : numbro(validator.commission.rate).format('0.00%') }
</CardText>:null}
</CardText>:null}
{(!isActive)?<CardText className="last-seen data">
<i className="material-icons">access_time </i>
{validator.lastSeen?<TimeStamp time={validator.lastSeen}/>:
(validator.unbonding_time?<TimeStamp time={validator.unbonding_time}/>:null)}
<i className="material-icons">access_time </i>
{validator.lastSeen?<TimeStamp time={validator.lastSeen}/>:
(validator.unbonding_time?<TimeStamp time={validator.unbonding_time}/>:null)}
</CardText>:null}
{(!isActive)?<CardText className="bond-status data" xs={2}>
<Col xs={6}>{(validator.status == 0)?<Badge color="secondary">Unbonded</Badge>:<Badge color="warning">Unbonding</Badge>}</Col>
<Col xs={6}>{validator.jailed?<Badge color="danger">Jailed</Badge>:''}</Col>
<Col xs={6}>{(validator.status == 1)?<Badge color="secondary">Unbonded</Badge>:<Badge color="warning">Unbonding</Badge>}</Col>
<Col xs={6}>{validator.jailed?<Badge color="danger">Jailed</Badge>:''}</Col>
</CardText>:null}
{(isActive)?<CardText className="uptime data">
<i className="material-icons">flash_on</i><Progress value={validator.uptime} style={{width:'70%', display:'inline-block'}}>{validator.uptime?numbro(validator.uptime/100).format('0%'):0}
</Progress>
<i className="material-icons">flash_on</i><Progress value={validator.uptime} style={{width:'70%', display:'inline-block'}}>{validator.uptime?numbro(validator.uptime/100).format('0%'):0}
</Progress>
</CardText>:null}
</PopoverBody>
</Card>
</PopoverBody>
</Card>
</UncontrolledPopover>
}

Expand Down
4 changes: 2 additions & 2 deletions imports/ui/ledger/LedgerActions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const Fee = (props) => {
}

const isActiveValidator = (validator) => {
return !validator.jailed && validator.status == 2;
return !validator.jailed && validator.status == 3;
}

const isBetween = (value, min, max) => {
Expand Down Expand Up @@ -524,7 +524,7 @@ class LedgerButton extends Component {

getValidatorOptions = () => {
let activeValidators = Validators.find(
{"jailed": false, "status": 2},
{"jailed": false, "status": 3},
{"sort":{"description.moniker":1}}
);
let redelegations = this.state.redelegations || {};
Expand Down
2 changes: 1 addition & 1 deletion imports/ui/validators/List.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ValidatorRow = (props) => {
{(!props.inactive)?<Col className="commission data" xs={{size:4}} md={{size:1,offset:0}} lg={2}><i className="material-icons d-sm-none">call_split</i> <span>{(props.validator.commission&&props.validator.commission.commission_rates)?numbro(props.validator.commission.commission_rates.rate).format('0.00%'):''}</span></Col>:''}
{(!props.inactive)?<Col className="uptime data" xs={{size:2,order:"last"}} md={4}><Progress animated value={props.validator.uptime}><span className="d-none d-md-inline">{props.validator.uptime?props.validator.uptime.toFixed(2):0}%</span><span className="d-md-none">&nbsp;</span></Progress></Col>:''}
{(props.inactive)?<Col className="last-seen data" xs={{size:10,offset:2}}md={{size:3, offset:0}}>{props.validator.lastSeen?<TimeStamp time={props.validator.lastSeen}/>:''}</Col>:''}
{(props.inactive)?<Col className="bond-status data" xs={2} md={1}>{(props.validator.status == 0)?<Badge color="secondary"><span>U<span className="d-none d-md-inline">nbonded</span></span></Badge>:<Badge color="warning"><span>U<span className="d-none d-md-inline">nbonding</span></span></Badge>}</Col>:''}
{(props.inactive)?<Col className="bond-status data" xs={2} md={1}>{(props.validator.status == 1)?<Badge color="secondary"><span>U<span className="d-none d-md-inline">nbonded</span></span></Badge>:<Badge color="warning"><span>U<span className="d-none d-md-inline">nbonding</span></span></Badge>}</Col>:''}
{(props.inactive)?<Col className="jail-status data" xs={2} md={1}>{props.validator.jailed?<Badge color="danger"><span>J<span className="d-none d-md-inline">ailed</span></span></Badge>:''}</Col>:''}
</Row></SentryBoundary>
</Card>
Expand Down
2 changes: 1 addition & 1 deletion imports/ui/validators/ListContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default ValidatorListContainer = withTracker((props) => {
}
else{
validatorsCond = {
// jailed: false,
jailed: false,
status: 3
}
}
Expand Down

0 comments on commit 4a5863b

Please sign in to comment.