diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-07-05 22:39:33 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-07-05 23:47:53 +0800 |
commit | 2298daa53e56c197d4a16273e432da785c89f673 (patch) | |
tree | 5d562ae61a03263a6574646986622c31ccebd759 /ui | |
parent | 46cda26f3b982fb7ff26c29d2137540a5dc49457 (diff) | |
download | tangerine-wallet-browser-2298daa53e56c197d4a16273e432da785c89f673.tar tangerine-wallet-browser-2298daa53e56c197d4a16273e432da785c89f673.tar.gz tangerine-wallet-browser-2298daa53e56c197d4a16273e432da785c89f673.tar.bz2 tangerine-wallet-browser-2298daa53e56c197d4a16273e432da785c89f673.tar.lz tangerine-wallet-browser-2298daa53e56c197d4a16273e432da785c89f673.tar.xz tangerine-wallet-browser-2298daa53e56c197d4a16273e432da785c89f673.tar.zst tangerine-wallet-browser-2298daa53e56c197d4a16273e432da785c89f673.zip |
Prevent calling setState in TxListItem after unmount
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/tx-list-item.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/app/components/tx-list-item.js b/ui/app/components/tx-list-item.js index 9a2fb5311..e539514ec 100644 --- a/ui/app/components/tx-list-item.js +++ b/ui/app/components/tx-list-item.js @@ -54,6 +54,8 @@ function TxListItem () { fiatTotal: null, isTokenTx: null, } + + this.unmounted = false } TxListItem.prototype.componentDidMount = async function () { @@ -67,9 +69,16 @@ TxListItem.prototype.componentDidMount = async function () { ? await this.getSendTokenTotal() : this.getSendEtherTotal() + if (this.unmounted) { + return + } this.setState({ total, fiatTotal, isTokenTx }) } +TxListItem.prototype.componentWillUnmount = function () { + this.unmounted = true +} + TxListItem.prototype.getAddressText = function () { const { address, |