1
0
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:
Whymarrh Whitby 2020-08-14 11:57:42 -02:30 committed by GitHub
parent 5d42a9b773
commit 937616565d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) => {