From e34b0af25133629ad4c177c4d7d5050bd6ac19b8 Mon Sep 17 00:00:00 2001
From: Leonid Logvinov <logvinov.leon@gmail.com>
Date: Wed, 10 Jan 2018 12:39:37 +0100
Subject: Fix ts error in portal after enabling more strict checks

---
 .../website/ts/components/dialogs/ledger_config_dialog.tsx     | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'packages/website/ts/components/dialogs/ledger_config_dialog.tsx')

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.',
-- 
cgit v1.2.3

