diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-07-14 03:19:21 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-07-14 03:19:21 +0800 |
commit | 55382e9842c4f4136c88e441298193cc7abd8ba9 (patch) | |
tree | 2d0b284115977f8a864dc130eaa677a2097f3088 /ui/app/components | |
parent | 53995463883c062157a3d725e7cb8fe54486badb (diff) | |
download | tangerine-wallet-browser-55382e9842c4f4136c88e441298193cc7abd8ba9.tar tangerine-wallet-browser-55382e9842c4f4136c88e441298193cc7abd8ba9.tar.gz tangerine-wallet-browser-55382e9842c4f4136c88e441298193cc7abd8ba9.tar.bz2 tangerine-wallet-browser-55382e9842c4f4136c88e441298193cc7abd8ba9.tar.lz tangerine-wallet-browser-55382e9842c4f4136c88e441298193cc7abd8ba9.tar.xz tangerine-wallet-browser-55382e9842c4f4136c88e441298193cc7abd8ba9.tar.zst tangerine-wallet-browser-55382e9842c4f4136c88e441298193cc7abd8ba9.zip |
fix account selection
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/pages/create-account/connect-hardware/index.js | 8 |
1 files changed, 6 insertions, 2 deletions
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 689e88f2e..dc9907f31 100644 --- a/ui/app/components/pages/create-account/connect-hardware/index.js +++ b/ui/app/components/pages/create-account/connect-hardware/index.js @@ -59,8 +59,11 @@ class ConnectHardwareForm extends Component { 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 + accounts.forEach((a, i) => { + if (a.address.toLowerCase() === this.props.address) { + newState.selectedAccount = a.index.toString() + } + }) // 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 @@ -167,6 +170,7 @@ ConnectHardwareForm.propTypes = { t: PropTypes.func, network: PropTypes.string, accounts: PropTypes.object, + address: PropTypes.string, } const mapStateToProps = state => { |