diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-10 19:39:37 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-01-10 19:43:50 +0800 |
commit | e34b0af25133629ad4c177c4d7d5050bd6ac19b8 (patch) | |
tree | 936eae17521984e5ccc28057973461e707322326 /packages/website/ts/components/dialogs | |
parent | fa7237fde7acea32c5492f0dcdef4d55b3ade6e1 (diff) | |
download | dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.gz dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.bz2 dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.lz dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.xz dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.zst dexon-sol-tools-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.zip |
Fix ts error in portal after enabling more strict checks
Diffstat (limited to 'packages/website/ts/components/dialogs')
-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.', |