aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/scripts/metamask-controller.js4
-rw-r--r--ui/app/components/pages/create-account/connect-hardware/index.js6
2 files changed, 3 insertions, 7 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 8104374bc..08b75e839 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -550,7 +550,9 @@ module.exports = class MetamaskController extends EventEmitter {
}
// Merge with existing accounts
- this.accountTracker.syncWithAddresses(oldAccounts.concat(accounts.map(a => a.address)))
+ // and make sure addresses are not repeated
+ const accountsToTrack = [...new Set(oldAccounts.concat(accounts.map(a => a.address.toLowerCase())))]
+ this.accountTracker.syncWithAddresses(accountsToTrack)
return accounts
default:
diff --git a/ui/app/components/pages/create-account/connect-hardware/index.js b/ui/app/components/pages/create-account/connect-hardware/index.js
index 1aaa0be64..126102235 100644
--- a/ui/app/components/pages/create-account/connect-hardware/index.js
+++ b/ui/app/components/pages/create-account/connect-hardware/index.js
@@ -37,7 +37,6 @@ class ConnectHardwareForm extends Component {
const { accounts } = this.props
const balanceValue = accounts && accounts[address.toLowerCase()] ? accounts[address.toLowerCase()].balance : ''
const formattedBalance = balanceValue !== null ? formatBalance(balanceValue, 6) : '...'
- console.log('[TREZOR]: got balance', address, accounts, balanceValue, formattedBalance)
return formattedBalance
}
@@ -45,21 +44,17 @@ class ConnectHardwareForm extends Component {
this.props
.connectHardware('trezor', page)
.then(accounts => {
- console.log('[TREZOR]: GOT PAGE!', accounts)
if (accounts.length) {
const newState = {}
// Default to the first account
if (this.state.selectedAccount === null) {
const firstAccount = accounts[0]
newState.selectedAccount = firstAccount.index.toString() === '0' ? firstAccount.index.toString() : null
- console.log('[TREZOR]: just defaulted to account', newState.selectedAccount)
// If the page doesn't contain the selected account, let's deselect it
} else if (!accounts.filter(a => a.index.toString() === this.state.selectedAccount).length) {
newState.selectedAccount = null
- console.log('[TREZOR]: just removed default account', newState.selectedAccount)
}
- console.log('[TREZOR]: mapping balances')
// Map accounts with balances
newState.accounts = accounts.map(account => {
@@ -67,7 +62,6 @@ class ConnectHardwareForm extends Component {
return account
})
- console.log('[TREZOR]: ABOUT TO RENDER ACCOUNTS: ', page, newState.accounts)
this.setState(newState)
}
})