diff options
author | Leonid <logvinov.leon@gmail.com> | 2018-01-11 02:35:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-11 02:35:37 +0800 |
commit | de943c5f305402bc64a6b3273c59669faa62a60d (patch) | |
tree | 936eae17521984e5ccc28057973461e707322326 /packages/website/ts/components/dialogs/ledger_config_dialog.tsx | |
parent | e6a783aff803c276392efec93571d24fc96feb6e (diff) | |
parent | e34b0af25133629ad4c177c4d7d5050bd6ac19b8 (diff) | |
download | dexon-0x-contracts-de943c5f305402bc64a6b3273c59669faa62a60d.tar.gz dexon-0x-contracts-de943c5f305402bc64a6b3273c59669faa62a60d.tar.zst dexon-0x-contracts-de943c5f305402bc64a6b3273c59669faa62a60d.zip |
Merge pull request #307 from 0xProject/feature/web3-type-roots
Base tsconfig.json
Diffstat (limited to 'packages/website/ts/components/dialogs/ledger_config_dialog.tsx')
-rw-r--r-- | packages/website/ts/components/dialogs/ledger_config_dialog.tsx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx index c8547694a..60db93c52 100644 --- a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx +++ b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx @@ -134,7 +134,7 @@ export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps, labelReady="Update" labelLoading="Updating..." labelComplete="Updated!" - onClickAsyncFn={this._onFetchAddressesForDerivationPathAsync.bind(this, true)} + onClickAsyncFn={this._onFetchAddressesForDerivationPathAsync.bind(this)} /> </div> </div> @@ -191,13 +191,15 @@ export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps, const isOpen = false; this.props.toggleDialogFn(isOpen); } - private async _onFetchAddressesForDerivationPathAsync() { + private async _onFetchAddressesForDerivationPathAsync(): Promise<boolean> { const currentlySetPath = this.props.blockchain.getLedgerDerivationPathIfExists(); + let didSucceed; if (currentlySetPath === this.state.derivationPath) { - return; + didSucceed = true; + return didSucceed; } this.props.blockchain.updateLedgerDerivationPathIfExists(this.state.derivationPath); - const didSucceed = await this._fetchAddressesAndBalancesAsync(); + didSucceed = await this._fetchAddressesAndBalancesAsync(); if (!didSucceed) { this.setState({ derivationErrMsg: 'Failed to connect to Ledger.', |