mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-02 11:15:35 +03:00
fixed delegated amount not changing bug when from changes
This commit is contained in:
parent
d5bdf24905
commit
2d43a4df3d
@ -69,6 +69,13 @@ class DelegateScreen extends Component {
|
||||
this.amountTextInput = React.createRef();
|
||||
}
|
||||
|
||||
// Component Lifecycles
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
if (prevState.from !== this.state.from) {
|
||||
this._fetchReceivedVestingShare();
|
||||
}
|
||||
}
|
||||
|
||||
// Component Functions
|
||||
_setState = (key, value) => {
|
||||
const { getAccountsWithUsername, balance } = this.props;
|
||||
@ -146,6 +153,10 @@ class DelegateScreen extends Component {
|
||||
this.setState({
|
||||
delegatedHP: vestsToHp(vest_shares.amount, hivePerMVests).toFixed(3),
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
delegatedHP: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setState({
|
||||
|
Loading…
Reference in New Issue
Block a user