diff options
author | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-07-24 02:58:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-24 02:58:29 +0800 |
commit | b208d33b3b27a7f9c7ca2880e8b292d692651343 (patch) | |
tree | e069e40709c9c8211a7dbb353e5f0afa3922e90d | |
parent | 239f5110e990e78f84224152c7dad9cb84f0c756 (diff) | |
parent | bcbe7fef2e30d97465fb3f94d92293e1ea11e56f (diff) | |
download | tangerine-wallet-browser-b208d33b3b27a7f9c7ca2880e8b292d692651343.tar tangerine-wallet-browser-b208d33b3b27a7f9c7ca2880e8b292d692651343.tar.gz tangerine-wallet-browser-b208d33b3b27a7f9c7ca2880e8b292d692651343.tar.bz2 tangerine-wallet-browser-b208d33b3b27a7f9c7ca2880e8b292d692651343.tar.lz tangerine-wallet-browser-b208d33b3b27a7f9c7ca2880e8b292d692651343.tar.xz tangerine-wallet-browser-b208d33b3b27a7f9c7ca2880e8b292d692651343.tar.zst tangerine-wallet-browser-b208d33b3b27a7f9c7ca2880e8b292d692651343.zip |
Merge pull request #4851 from MetaMask/fix-trezor-alert
Fix trezor "Hardware wallet connected" alert
-rw-r--r-- | ui/app/components/pages/create-account/connect-hardware/index.js | 15 |
1 files changed, 11 insertions, 4 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 cc3761c04..3f66e7098 100644 --- a/ui/app/components/pages/create-account/connect-hardware/index.js +++ b/ui/app/components/pages/create-account/connect-hardware/index.js @@ -17,6 +17,7 @@ class ConnectHardwareForm extends Component { selectedAccount: null, accounts: [], browserSupported: true, + unlocked: false, } } @@ -32,9 +33,14 @@ class ConnectHardwareForm extends Component { } - async componentDidMount () { + componentDidMount () { + this.checkIfUnlocked() + } + + async checkIfUnlocked () { const unlocked = await this.props.checkHardwareStatus('trezor') if (unlocked) { + this.setState({unlocked: true}) this.getPage(0) } } @@ -66,12 +72,12 @@ class ConnectHardwareForm extends Component { if (accounts.length) { // If we just loaded the accounts for the first time - // show the global alert - if (this.state.accounts.length === 0) { + // (device previously locked) show the global alert + if (this.state.accounts.length === 0 && !this.state.unlocked) { this.showTemporaryAlert() } - const newState = {} + const newState = { unlocked: true } // Default to the first account if (this.state.selectedAccount === null) { accounts.forEach((a, i) => { @@ -112,6 +118,7 @@ class ConnectHardwareForm extends Component { btnText: this.context.t('connectToTrezor'), selectedAccount: null, accounts: [], + unlocked: false, }) }).catch(e => { this.setState({ error: e.toString() }) |