aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-07-05 20:54:01 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-07-05 21:24:51 +0800
commit0116ea9b95c5a9ab35d23e814a1783ef2bc11c25 (patch)
treebe153101d564a0f5c4f0f50b6572ac5bd86183c8
parent46cda26f3b982fb7ff26c29d2137540a5dc49457 (diff)
downloadtangerine-wallet-browser-0116ea9b95c5a9ab35d23e814a1783ef2bc11c25.tar
tangerine-wallet-browser-0116ea9b95c5a9ab35d23e814a1783ef2bc11c25.tar.gz
tangerine-wallet-browser-0116ea9b95c5a9ab35d23e814a1783ef2bc11c25.tar.bz2
tangerine-wallet-browser-0116ea9b95c5a9ab35d23e814a1783ef2bc11c25.tar.lz
tangerine-wallet-browser-0116ea9b95c5a9ab35d23e814a1783ef2bc11c25.tar.xz
tangerine-wallet-browser-0116ea9b95c5a9ab35d23e814a1783ef2bc11c25.tar.zst
tangerine-wallet-browser-0116ea9b95c5a9ab35d23e814a1783ef2bc11c25.zip
Remove TokenTracker listeners when unmounting component
-rw-r--r--ui/app/components/token-balance.js2
-rw-r--r--ui/app/components/token-list.js2
2 files changed, 4 insertions, 0 deletions
diff --git a/ui/app/components/token-balance.js b/ui/app/components/token-balance.js
index df3bd59bb..5464294ce 100644
--- a/ui/app/components/token-balance.js
+++ b/ui/app/components/token-balance.js
@@ -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)
}
diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js
index 4189cf801..89434f213 100644
--- a/ui/app/components/token-list.js
+++ b/ui/app/components/token-list.js
@@ -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 = []) {