Default the derivation path to that found in the Ledger subprovider

This commit is contained in:
Fabio Berger
2018-01-30 20:10:51 +01:00
parent da1071526f
commit 5019c51940

View File

@@ -45,12 +45,15 @@ interface LedgerConfigDialogState {
export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps, LedgerConfigDialogState> {
constructor(props: LedgerConfigDialogProps) {
super(props);
const derivationPathIfExists = props.blockchain.getLedgerDerivationPathIfExists();
this.state = {
connectionErrMsg: '',
stepIndex: LedgerSteps.CONNECT,
userAddresses: [],
addressBalances: [],
derivationPath: configs.DEFAULT_DERIVATION_PATH,
derivationPath: _.isUndefined(derivationPathIfExists)
? configs.DEFAULT_DERIVATION_PATH
: derivationPathIfExists,
derivationErrMsg: '',
preferredNetworkId: props.networkId,
};