Don't update token balances after tracker is stopped

This commit is contained in:
Whymarrh Whitby 2018-07-05 10:34:16 -02:30
parent 0116ea9b95
commit 783559f94e
3 changed files with 10 additions and 0 deletions

View File

@ -98,6 +98,10 @@ TokenBalance.prototype.componentDidUpdate = function (nextProps) {
}
TokenBalance.prototype.updateBalance = function (tokens = []) {
if (!this.tracker.running) {
return
}
const [{ string, symbol }] = tokens
this.setState({

View File

@ -158,6 +158,9 @@ TokenList.prototype.componentDidUpdate = function (nextProps) {
}
TokenList.prototype.updateBalances = function (tokens) {
if (!this.tracker.running) {
return
}
this.setState({ tokens, isLoading: false })
}

View File

@ -75,6 +75,9 @@ const withTokenTracker = WrappedComponent => {
}
updateBalance (tokens = []) {
if (!this.tracker.running) {
return
}
const [{ string, symbol }] = tokens
this.setState({ string, symbol, error: null })
}