mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Tidy ConnectHardwareForm#checkIfUnlocked (#9224)
This change tidies up the implementation of `ConnectHardwareForm#checkIfUnlocked`—passing an `async` function to `forEach` doesn't ensure that the one is run before the other.
This commit is contained in:
parent
5d42a9b773
commit
937616565d
@ -35,13 +35,13 @@ class ConnectHardwareForm extends Component {
|
||||
}
|
||||
|
||||
async checkIfUnlocked () {
|
||||
['trezor', 'ledger'].forEach(async (device) => {
|
||||
for (const device of ['trezor', 'ledger']) {
|
||||
const unlocked = await this.props.checkHardwareStatus(device, this.props.defaultHdPaths[device])
|
||||
if (unlocked) {
|
||||
this.setState({ unlocked: true })
|
||||
this.getPage(device, 0, this.props.defaultHdPaths[device])
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
connectToHardwareWallet = (device) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user