mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove TokenTracker listeners when unmounting component
This commit is contained in:
parent
46cda26f3b
commit
0116ea9b95
@ -110,5 +110,7 @@ TokenBalance.prototype.updateBalance = function (tokens = []) {
|
||||
TokenBalance.prototype.componentWillUnmount = function () {
|
||||
if (!this.tracker) return
|
||||
this.tracker.stop()
|
||||
this.tracker.removeListener('update', this.balanceUpdater)
|
||||
this.tracker.removeListener('error', this.showError)
|
||||
}
|
||||
|
||||
|
@ -164,6 +164,8 @@ TokenList.prototype.updateBalances = function (tokens) {
|
||||
TokenList.prototype.componentWillUnmount = function () {
|
||||
if (!this.tracker) return
|
||||
this.tracker.stop()
|
||||
this.tracker.removeListener('update', this.balanceUpdater)
|
||||
this.tracker.removeListener('error', this.showError)
|
||||
}
|
||||
|
||||
// function uniqueMergeTokens (tokensA, tokensB = []) {
|
||||
|
Loading…
Reference in New Issue
Block a user