Skip to content

Commit

Permalink
fix #194 on commission rate display
Browse files Browse the repository at this point in the history
  • Loading branch information
kwunyeung committed Sep 21, 2019
1 parent 9409ed3 commit 77a899a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions imports/ui/validators/Validator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class Validator extends Component{
componentDidUpdate(prevProps, prevState){
if (!this.isSameValidator(prevProps) || this.state.user !== prevState.user)
this.getUserDelegations();
if (!this.isSameValidator(prevProps)){
if (this.props.validator != prevProps.validator){
// if (this.props.validator.description.identity != prevProps.validator.description.identity){
if ((this.props.validator.description) && (this.props.validator.description != prevProps.validator.description)){
// console.log(prevProps.validator.description);
Expand Down Expand Up @@ -222,11 +222,11 @@ export default class Validator extends Component{
<Col sm={4} className="label"><T>validators.selfDelegationAddress</T></Col>
<Col sm={8} className="value address" data-delegator-address={this.props.validator.delegator_address}><Link to={"/account/"+this.props.validator.delegator_address}>{this.props.validator.delegator_address}</Link></Col>
<Col sm={4} className="label"><T>validators.commissionRate</T></Col>
<Col sm={8} className="value">{this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.rate).format('0.00')+"%":''} <small className="text-secondary">({this.state.updateTime})</small></Col>
<Col sm={8} className="value">{this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.rate*100).format('0.00')+"%":''} <small className="text-secondary">({this.state.updateTime})</small></Col>
<Col sm={4} className="label"><T>validators.maxRate</T></Col>
<Col sm={8} className="value">{this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.max_rate).format('0.00')+"%":''}</Col>
<Col sm={8} className="value">{this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.max_rate*100).format('0.00')+"%":''}</Col>
<Col sm={4} className="label"><T>validators.maxChangeRate</T></Col>
<Col sm={8} className="value">{this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.max_change_rate).format('0.00')+"%":''}</Col>
<Col sm={8} className="value">{this.props.validator.commission&&this.props.validator.commission.commission_rates?numbro(this.props.validator.commission.commission_rates.max_change_rate*100).format('0.00')+"%":''}</Col>
</Row>
</CardBody>
</Card>
Expand Down

0 comments on commit 77a899a

Please sign in to comment.