diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-06-28 02:37:24 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-06-28 02:37:24 +0800 |
commit | 360927ec77d5ea50848f4c1b2c66566542a28d1c (patch) | |
tree | 0afe499e034ed1e85db69b762a77ad9cd518f3f4 /packages/website | |
parent | b6f546ebe0b71ce450c1e724fc8f3b670bf97773 (diff) | |
download | dexon-0x-contracts-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar dexon-0x-contracts-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar.gz dexon-0x-contracts-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar.bz2 dexon-0x-contracts-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar.lz dexon-0x-contracts-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar.xz dexon-0x-contracts-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar.zst dexon-0x-contracts-360927ec77d5ea50848f4c1b2c66566542a28d1c.zip |
Changing provider to ledger more consistent with previous experience
Diffstat (limited to 'packages/website')
-rw-r--r-- | packages/website/ts/blockchain.ts | 8 | ||||
-rw-r--r-- | packages/website/ts/components/dialogs/ledger_config_dialog.tsx | 2 |
2 files changed, 5 insertions, 5 deletions
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<void> { - 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<LedgerConfigDialogProps, stepIndex: LedgerSteps.SELECT_ADDRESS, connectionErrMsg: '', }); - } else { - this.props.dispatcher.updateBlockchainIsLoaded(true); } return didSucceed; } |