fix asking permission if metamask is locked

pull/5370/head
yann300 2 years ago committed by Aniket
parent 5216131a9e
commit 2689e53e5a
  1. 2
      apps/remix-ide/src/app/providers/injected-provider.tsx

@ -38,7 +38,7 @@ export class InjectedProvider extends Plugin implements IProvider {
throw new Error(noInjectedProviderMsg)
} else {
if (injectedProvider && injectedProvider._metamask && injectedProvider._metamask.isUnlocked) {
if (!await injectedProvider._metamask.isUnlocked()) throw new Error('Please make sure the injected provider is unlocked (e.g Metamask).')
if (!await injectedProvider._metamask.isUnlocked()) this.call('notification', 'toast', 'Please make sure the injected provider is unlocked (e.g Metamask).')
}
this.askPermission(true)
}

Loading…
Cancel
Save