aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-07-14 03:19:21 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-07-14 03:19:21 +0800
commit55382e9842c4f4136c88e441298193cc7abd8ba9 (patch)
tree2d0b284115977f8a864dc130eaa677a2097f3088 /ui/app/components
parent53995463883c062157a3d725e7cb8fe54486badb (diff)
downloadtangerine-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.js8
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 => {