Skip to content

Commit

Permalink
delegations fetch fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
SrikanthSoparla committed Dec 3, 2024
1 parent e62cae8 commit b23a9ed
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/containers/NavBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,14 @@ class NavBar extends Component {
}

if ((pp.address !== this.props.address) && (pp.address !== '') && (this.props.address !== '')) {
this.props.getBalance(this.props.address);
this.props.getBalance(this.props.address, (result) => {
if (result) {
this.props.getDelegations(this.props.address);
}
});
this.props.fetchVestingBalance(this.props.address);
this.props.fetchRewards(this.props.address);
this.props.getUnBondingDelegations(this.props.address);
this.props.getDelegations(this.props.address);
this.props.getDelegatedValidatorsDetails(this.props.address);
}
}
Expand Down Expand Up @@ -289,7 +292,17 @@ class NavBar extends Component {
handleFetch (address) {
if (this.props.balance && !this.props.balance.length &&
!this.props.balanceInProgress) {
this.props.getBalance(address);
this.props.getBalance(address, (result) => {
if (result) {
if (this.props.delegations && !this.props.delegations.length &&
!this.props.delegationsInProgress && !this.props.proposalTab) {
this.props.getDelegations(address);
}
}
});
} else if (this.props.delegations && !this.props.delegations.length &&
!this.props.delegationsInProgress && !this.props.proposalTab) {
this.props.getDelegations(address);
}
// if (this.props.vestingBalance && !this.props.vestingBalance.value &&
// !this.props.vestingBalanceInProgress) {
Expand All @@ -304,10 +317,6 @@ class NavBar extends Component {
// !this.props.unBondingDelegationsInProgress && !this.props.proposalTab && !this.props.stake) {
// this.props.getUnBondingDelegations(address);
// }
if (this.props.delegations && !this.props.delegations.length &&
!this.props.delegationsInProgress && !this.props.proposalTab) {
this.props.getDelegations(address);
}
if (this.props.delegatedValidatorList && !this.props.delegatedValidatorList.length &&
!this.props.delegatedValidatorListInProgress && !this.props.proposalTab) {
this.props.getDelegatedValidatorsDetails(address);
Expand Down

0 comments on commit b23a9ed

Please sign in to comment.