mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Don't update token balances after tracker is stopped
This commit is contained in:
parent
0116ea9b95
commit
783559f94e
@ -98,6 +98,10 @@ TokenBalance.prototype.componentDidUpdate = function (nextProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TokenBalance.prototype.updateBalance = function (tokens = []) {
|
TokenBalance.prototype.updateBalance = function (tokens = []) {
|
||||||
|
if (!this.tracker.running) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const [{ string, symbol }] = tokens
|
const [{ string, symbol }] = tokens
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -158,6 +158,9 @@ TokenList.prototype.componentDidUpdate = function (nextProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TokenList.prototype.updateBalances = function (tokens) {
|
TokenList.prototype.updateBalances = function (tokens) {
|
||||||
|
if (!this.tracker.running) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.setState({ tokens, isLoading: false })
|
this.setState({ tokens, isLoading: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +75,9 @@ const withTokenTracker = WrappedComponent => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateBalance (tokens = []) {
|
updateBalance (tokens = []) {
|
||||||
|
if (!this.tracker.running) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const [{ string, symbol }] = tokens
|
const [{ string, symbol }] = tokens
|
||||||
this.setState({ string, symbol, error: null })
|
this.setState({ string, symbol, error: null })
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user