From 360927ec77d5ea50848f4c1b2c66566542a28d1c Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 27 Jun 2018 11:37:24 -0700 Subject: Changing provider to ledger more consistent with previous experience --- packages/website/ts/blockchain.ts | 8 +++++--- packages/website/ts/components/dialogs/ledger_config_dialog.tsx | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 4a041d20c..18363a4c7 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -773,9 +773,9 @@ export class Blockchain { const networkIdIfExists = await Blockchain._getInjectedWeb3ProviderNetworkIdIfExistsAsync(); this.networkId = !_.isUndefined(networkIdIfExists) ? networkIdIfExists : constants.NETWORK_ID_MAINNET; const injectedWeb3IfExists = Blockchain._getInjectedWeb3(); - if (injectedWeb3IfExists) { + if (!_.isUndefined(injectedWeb3IfExists) && !_.isUndefined(injectedWeb3IfExists.currentProvider)) { const injectedProviderObservable = injectedWeb3IfExists.currentProvider.publicConfigStore; - if (injectedProviderObservable && !this._injectedProviderObservable) { + if (!_.isUndefined(injectedProviderObservable) && _.isUndefined(this._injectedProviderObservable)) { this._injectedProviderObservable = injectedProviderObservable; this._injectedProviderObservable.subscribe(this._injectedProviderUpdateHandler); } @@ -790,7 +790,9 @@ export class Blockchain { shouldPollUserAddress: boolean = false, shouldUserLedgerProvider: boolean = false, ): Promise { - this._dispatcher.updateBlockchainIsLoaded(false); + if (!shouldUserLedgerProvider) { + this._dispatcher.updateBlockchainIsLoaded(false); + } this._dispatcher.updateUserWeiBalance(undefined); this.networkId = networkId; const injectedWeb3IfExists = Blockchain._getInjectedWeb3(); diff --git a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx index 81071d404..38e4732a4 100644 --- a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx +++ b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx @@ -284,8 +284,6 @@ export class LedgerConfigDialog extends React.Component