diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-08-14 13:26:18 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-08-14 13:26:18 +0800 |
commit | 61a279204a804ddf4815d0db6103c19c5640bbb9 (patch) | |
tree | f2e1bea86e79f1f43191d05ed18d9e870fb2fc45 /ui/app/components/pages/create-account/connect-hardware/index.js | |
parent | 4e1d8ba19db729f5c282c4e3c6b43433b562a45e (diff) | |
download | tangerine-wallet-browser-61a279204a804ddf4815d0db6103c19c5640bbb9.tar.gz tangerine-wallet-browser-61a279204a804ddf4815d0db6103c19c5640bbb9.tar.zst tangerine-wallet-browser-61a279204a804ddf4815d0db6103c19c5640bbb9.zip |
legacy and new hd path working
Diffstat (limited to 'ui/app/components/pages/create-account/connect-hardware/index.js')
-rw-r--r-- | ui/app/components/pages/create-account/connect-hardware/index.js | 15 |
1 files changed, 10 insertions, 5 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 0eb2aa16f..e7e94686a 100644 --- a/ui/app/components/pages/create-account/connect-hardware/index.js +++ b/ui/app/components/pages/create-account/connect-hardware/index.js @@ -43,7 +43,7 @@ class ConnectHardwareForm extends Component { const unlocked = await this.props.checkHardwareStatus(device, this.props.defaultHdPaths[device]) if (unlocked) { this.setState({unlocked: true}) - this.getPage(0, device, this.props.defaultHdPaths[device]) + this.getPage(device, 0, this.props.defaultHdPaths[device]) } }) } @@ -55,19 +55,23 @@ class ConnectHardwareForm extends Component { // Default values this.setState({ btnText: this.context.t('connecting')}) - this.getPage(0, device, this.props.defaultHdPaths[device]) + this.getPage(device, 0, this.props.defaultHdPaths[device]) } onPathChange = (path) => { console.log('BRUNO: path changed', path) this.props.setHardwareWalletDefaultHdPath({device: this.state.device, path}) - this.getPage(0, this.state.device, path) + this.getPage(this.state.device, 0, path) } onAccountChange = (account) => { this.setState({selectedAccount: account.toString(), error: null}) } + onAccountRestriction = () => { + this.setState({error: this.context.t('ledgerAccountRestriction') }) + } + showTemporaryAlert () { this.props.showAlert(this.context.t('hardwareWalletConnected')) // Autohide the alert after 5 seconds @@ -76,7 +80,7 @@ class ConnectHardwareForm extends Component { }, 5000) } - getPage = (page, device, hdPath) => { + getPage = (device, page, hdPath) => { this.props .connectHardware(device, page, hdPath) .then(accounts => { @@ -182,6 +186,7 @@ class ConnectHardwareForm extends Component { onUnlockAccount: this.onUnlockAccount, onForgetDevice: this.onForgetDevice, onCancel: this.onCancel, + onAccountRestriction: this.onAccountRestriction, }) } @@ -237,7 +242,7 @@ const mapDispatchToProps = dispatch => { return dispatch(actions.setHardwareWalletDefaultHdPath({device, path})) }, connectHardware: (deviceName, page, hdPath) => { - return dispatch(actions.connectHardware(deviceName, hdPath, page)) + return dispatch(actions.connectHardware(deviceName, page, hdPath)) }, checkHardwareStatus: (deviceName, hdPath) => { return dispatch(actions.checkHardwareStatus(deviceName, hdPath)) |