From a2781df8b4ce8d1fc03080eb3361217a236ec82d Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 19 Jun 2017 19:11:55 -0700 Subject: Add better event lifecycle management to token list. Token list now renders errors when a token lookup fails. Also now cleans up event listeners when re-initializing the token list. --- ui/app/components/token-list.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js index c560a6072..633d3ccfe 100644 --- a/ui/app/components/token-list.js +++ b/ui/app/components/token-list.js @@ -24,7 +24,7 @@ function TokenList () { TokenList.prototype.render = function () { const state = this.state - const { tokens, isLoading } = state + const { tokens, isLoading, error } = state const { userAddress } = this.props @@ -32,6 +32,11 @@ TokenList.prototype.render = function () { return this.message('Loading') } + if (error) { + log.error(error) + return this.message('There was a problem loading your token balances.') + } + const network = this.props.network const tokenViews = tokens.map((tokenData) => { @@ -85,7 +90,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 @@ -97,9 +105,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()) -- cgit v1.2.3 From c7780727eb26cd35806f36aaf91cfb6865dd9693 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 20 Jun 2017 09:01:55 -0700 Subject: Bump circleCI node version to 8.0.0 --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 4305ca3b4..1f018ac24 100644 --- a/circle.yml +++ b/circle.yml @@ -1,6 +1,6 @@ machine: node: - version: 7.6.0 + version: 8.0.0 dependencies: pre: - "npm i -g testem" -- cgit v1.2.3 From 044c16219bff7c583b57edeee913dd576930031e Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 20 Jun 2017 15:38:23 -0700 Subject: Fix badge number to include personal_sign --- app/scripts/background.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scripts/background.js b/app/scripts/background.js index 1dbfb1b98..e8987394f 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -116,13 +116,15 @@ function setupController (initState) { updateBadge() controller.txController.on('updateBadge', updateBadge) controller.messageManager.on('updateBadge', updateBadge) + controller.personalMessageManager.on('updateBadge', updateBadge) // plugin badge text function updateBadge () { var label = '' var unapprovedTxCount = controller.txController.unapprovedTxCount var unapprovedMsgCount = controller.messageManager.unapprovedMsgCount - var count = unapprovedTxCount + unapprovedMsgCount + var unapprovedPersonalMsgs = controller.personalMessageManager.unapprovedPersonalMsgCount + var count = unapprovedTxCount + unapprovedMsgCount + unapprovedPersonalMsgs if (count) { label = String(count) } -- cgit v1.2.3 From b3a6df2dca7b5b9fef883fded020c6bd7a7320fa Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 20 Jun 2017 15:41:34 -0700 Subject: Bump changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d3e86342..c040b630c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Add a warning to JSON file import. - Fix bug where slowly mined txs would sometimes be incorrectly marked as failed. +- Fix bug where badge count did not reflect personal_sign pending messages. ## 3.7.8 2017-6-12 -- cgit v1.2.3 From d0294720e22c3c616b3fb049ae22a69dcbe8620f Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 20 Jun 2017 18:23:49 -0700 Subject: Make seed confirmation wording scarier --- ui/app/keychains/hd/create-vault-complete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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', { -- cgit v1.2.3 From 2f4ebea30654c7c18f601e3136914d74edfdeca0 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 20 Jun 2017 18:26:08 -0700 Subject: Bump changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c040b630c..8200c0d3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Add a warning to JSON file import. - Fix bug where slowly mined txs would sometimes be incorrectly marked as failed. - Fix bug where badge count did not reflect personal_sign pending messages. +- Seed word confirmation wording is now scarier. ## 3.7.8 2017-6-12 -- cgit v1.2.3 From eb7a9d7517777e16f01b45a27a82100ea47bf3aa Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 21 Jun 2017 15:55:22 -0700 Subject: Fix broken malito link. --- ui/app/info.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ui/app/info.js b/ui/app/info.js index aa4503b62..89cb7854d 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!'), ]), ]), -- cgit v1.2.3 From c0c588053a29a4406ef30de8628065429ff99595 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 22 Jun 2017 09:46:03 -0400 Subject: Print integration build errors --- test/integration/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/integration/index.js b/test/integration/index.js index f2d656b0b..85f91d92b 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -9,13 +9,15 @@ var b = browserify() // Remove old bundle try { fs.unlinkSync(bundlePath) -} catch (e) {} -var writeStream = fs.createWriteStream(bundlePath) + var writeStream = fs.createWriteStream(bundlePath) -tests.forEach(function (fileName) { - b.add(path.join(__dirname, 'lib', fileName)) -}) + tests.forEach(function (fileName) { + b.add(path.join(__dirname, 'lib', fileName)) + }) -b.bundle().pipe(writeStream) + b.bundle().pipe(writeStream) +} catch (e) { + console.error('Integration build failure', e) +} -- cgit v1.2.3