Make it such that users can switch between Ledger accounts without first switching back to an injected provider

This commit is contained in:
Fabio Berger
2018-01-29 12:10:49 +01:00
parent 45fdfc2d3d
commit af08177f79
3 changed files with 12 additions and 9 deletions

View File

@@ -190,8 +190,10 @@ export class Blockchain {
}
// Cache injected provider so that we can switch the user back to it easily
this._cachedProvider = this._web3Wrapper.getProviderObj();
this._cachedProviderNetworkId = this.networkId;
if (_.isUndefined(this._cachedProvider)) {
this._cachedProvider = this._web3Wrapper.getProviderObj();
this._cachedProviderNetworkId = this.networkId;
}
this._userAddress = '';
this._dispatcher.updateUserAddress(''); // Clear old userAddress