@ -226,6 +226,10 @@ export class Blockchain extends Plugin {
return this.executionContext.getProvider()
}
getInjectedWeb3Address () {
return this.executionContext.getSelectedAddress()
/**
* return the fork name applied to the current envionment
* @return {String} - fork name
@ -50,6 +50,10 @@ export class ExecutionContext {
return this.executionContext
getSelectedAddress () {
return injectedProvider ? injectedProvider.selectedAddress : null
getCurrentFork () {
return this.currentFork
@ -145,6 +145,13 @@ const fillAccountsList = async () => {
})
}))
const provider = plugin.blockchain.getProvider()
if (provider === 'injected') {
const selectedAddress = plugin.blockchain.getInjectedWeb3Address()
if (!(Object.keys(loadedAccounts).includes(selectedAddress))) setAccount(null)
dispatch(fetchAccountsListSuccess(loadedAccounts))
}).catch((e) => {
dispatch(fetchAccountsListFailed(e.message))
@ -37,6 +37,7 @@ export class Blockchain extends Plugin<any, any> {
setProviderFromEndpoint(target: any, context: any, cb: any): void;
detectNetwork(cb: any): void;
getProvider(): any;
getInjectedWeb3Address(): any;