Make it such that users can switch between Ledger accounts without first switching back to an injected provider

This commit is contained in:
Fabio Berger
2018-01-29 12:10:49 +01:00
parent 45fdfc2d3d
commit af08177f79
3 changed files with 12 additions and 9 deletions

View File

@@ -265,7 +265,10 @@ export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps,
return false;
}
if (this.props.providerType !== ProviderType.Ledger) {
if (
this.props.providerType !== ProviderType.Ledger ||
(this.props.providerType === ProviderType.Ledger && this.props.networkId !== this.state.preferredNetworkId)
) {
await this.props.blockchain.updateProviderToLedgerAsync(this.state.preferredNetworkId);
}