aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-06-28 02:37:24 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-28 02:37:24 +0800
commit360927ec77d5ea50848f4c1b2c66566542a28d1c (patch)
tree0afe499e034ed1e85db69b762a77ad9cd518f3f4 /packages/website
parentb6f546ebe0b71ce450c1e724fc8f3b670bf97773 (diff)
downloaddexon-sol-tools-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar
dexon-sol-tools-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar.gz
dexon-sol-tools-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar.bz2
dexon-sol-tools-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar.lz
dexon-sol-tools-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar.xz
dexon-sol-tools-360927ec77d5ea50848f4c1b2c66566542a28d1c.tar.zst
dexon-sol-tools-360927ec77d5ea50848f4c1b2c66566542a28d1c.zip
Changing provider to ledger more consistent with previous experience
Diffstat (limited to 'packages/website')
-rw-r--r--packages/website/ts/blockchain.ts8
-rw-r--r--packages/website/ts/components/dialogs/ledger_config_dialog.tsx2
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;
}