aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/dialogs/ledger_config_dialog.tsx
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-01-29 19:10:49 +0800
committerFabio Berger <me@fabioberger.com>2018-01-29 19:10:49 +0800
commitaf08177f79decd8dd3194d300a1fa43d43872229 (patch)
tree1158178bef439bd1e5f34623a98ea6efd7b50b15 /packages/website/ts/components/dialogs/ledger_config_dialog.tsx
parent45fdfc2d3d2bcfcb37d16f29df2e30524e6d7717 (diff)
downloaddexon-0x-contracts-af08177f79decd8dd3194d300a1fa43d43872229.tar.gz
dexon-0x-contracts-af08177f79decd8dd3194d300a1fa43d43872229.tar.zst
dexon-0x-contracts-af08177f79decd8dd3194d300a1fa43d43872229.zip
Make it such that users can switch between Ledger accounts without first switching back to an injected provider
Diffstat (limited to 'packages/website/ts/components/dialogs/ledger_config_dialog.tsx')
-rw-r--r--packages/website/ts/components/dialogs/ledger_config_dialog.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx
index a17a51622..66b04f198 100644
--- a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx
+++ b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx
@@ -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);
}