diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-06-23 23:00:58 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-06-23 23:00:58 +0800 |
commit | b04d1de44733065fe6762542eca843a7d9e3d099 (patch) | |
tree | 2086d693e02e5ef0570acb9f3b5dfe8a78e5ce65 /ui/app | |
parent | 97ab48ba0d5c0699b4ec0ad4bbc3d9c8805ef048 (diff) | |
parent | f022c7c714e17faf9558839116ba90ca8082e6b1 (diff) | |
download | tangerine-wallet-browser-b04d1de44733065fe6762542eca843a7d9e3d099.tar tangerine-wallet-browser-b04d1de44733065fe6762542eca843a7d9e3d099.tar.gz tangerine-wallet-browser-b04d1de44733065fe6762542eca843a7d9e3d099.tar.bz2 tangerine-wallet-browser-b04d1de44733065fe6762542eca843a7d9e3d099.tar.lz tangerine-wallet-browser-b04d1de44733065fe6762542eca843a7d9e3d099.tar.xz tangerine-wallet-browser-b04d1de44733065fe6762542eca843a7d9e3d099.tar.zst tangerine-wallet-browser-b04d1de44733065fe6762542eca843a7d9e3d099.zip |
Merge branch 'master' into i784-SendTokenButton
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/components/token-list.js | 22 | ||||
-rw-r--r-- | ui/app/info.js | 6 | ||||
-rw-r--r-- | ui/app/keychains/hd/create-vault-complete.js | 2 |
3 files changed, 20 insertions, 10 deletions
diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js index 100e596ed..d2d83de26 100644 --- a/ui/app/components/token-list.js +++ b/ui/app/components/token-list.js @@ -29,13 +29,18 @@ function TokenList () { TokenList.prototype.render = function () { const state = this.state - const { isLoading, tokens } = state + const { tokens, isLoading, error } = state const { userAddress, network } = this.props if (isLoading) { return this.message('Loading') } + if (error) { + log.error(error) + return this.message('There was a problem loading your token balances.') + } + const tokenViews = tokens.map((tokenData) => { tokenData.network = network tokenData.userAddress = userAddress @@ -114,7 +119,10 @@ TokenList.prototype.componentDidMount = function () { TokenList.prototype.createFreshTokenTracker = function () { if (this.tracker) { + // Clean up old trackers when refreshing: this.tracker.stop() + this.tracker.removeListener('update', this.balanceUpdater) + this.tracker.removeListener('error', this.showError) } if (!global.ethereumProvider) return @@ -126,9 +134,15 @@ TokenList.prototype.createFreshTokenTracker = function () { pollingInterval: 8000, }) - this.tracker.on('update', (tokenData) => { - this.updateBalances(tokenData) - }) + + // Set up listener instances for cleaning up + this.balanceUpdater = this.updateBalances.bind(this) + this.showError = (error) => { + this.setState({ error, isLoading: false }) + } + this.tracker.on('update', this.balanceUpdater) + this.tracker.on('error', this.showError) + this.tracker.updateBalances() .then(() => { this.updateBalances(this.tracker.serialize()) diff --git a/ui/app/info.js b/ui/app/info.js index 825796ed6..e8470de97 100644 --- a/ui/app/info.js +++ b/ui/app/info.js @@ -101,14 +101,12 @@ InfoScreen.prototype.render = function () { h('a.info', { href: 'https://github.com/MetaMask/faq', target: '_blank', - onClick (event) { this.navigateTo(event.target.href) }, }, 'Need Help? Read our FAQ!'), ]), h('div', [ h('a', { href: 'https://metamask.io/', target: '_blank', - onClick (event) { this.navigateTo(event.target.href) }, }, [ h('img.icon-size', { src: 'images/icon-128.png', @@ -126,7 +124,6 @@ InfoScreen.prototype.render = function () { h('a.info', { href: 'http://slack.metamask.io', target: '_blank', - onClick (event) { this.navigateTo(event.target.href) }, }, 'Join the conversation on Slack'), ]), @@ -134,7 +131,6 @@ InfoScreen.prototype.render = function () { h('a.info', { href: 'https://twitter.com/metamask_io', target: '_blank', - onClick (event) { this.navigateTo(event.target.href) }, }, 'Follow us on Twitter'), ]), @@ -142,7 +138,7 @@ InfoScreen.prototype.render = function () { h('a.info', { target: '_blank', style: { width: '85vw' }, - onClick () { this.navigateTo('mailto:help@metamask.io?subject=Feedback') }, + href: 'mailto:help@metamask.io?subject=Feedback', }, 'Email us!'), ]), ]), diff --git a/ui/app/keychains/hd/create-vault-complete.js b/ui/app/keychains/hd/create-vault-complete.js index 5230797ad..9741155f7 100644 --- a/ui/app/keychains/hd/create-vault-complete.js +++ b/ui/app/keychains/hd/create-vault-complete.js @@ -54,7 +54,7 @@ CreateVaultCompleteScreen.prototype.render = function () { textAlign: 'center', }, }, [ - h('span.error', 'These 12 words can restore all of your MetaMask accounts for this vault.\nSave them somewhere safe and secret.'), + h('span.error', 'These 12 words are the only way to restore your MetaMask accounts.\nSave them somewhere safe and secret.'), ]), h('textarea.twelve-word-phrase', { |