Merge branch 'master' into ppmm

pull/2826/head
Aniket 2 years ago committed by GitHub
commit 7200755262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/remix-ide/src/app/tabs/injected-provider.tsx
  2. 3
      apps/remix-ide/src/blockchain/execution-context.js

@ -30,7 +30,7 @@ export class InjectedProvider extends Plugin {
return reject(new Error('no injected provider found.'))
}
try {
if ((window as any) && typeof (window as any).ethereum.enable === 'function') (window as any).ethereum.enable()
if ((window as any) && typeof (window as any).ethereum.request === "function") (window as any).ethereum.request({ method: "eth_requestAccounts" });
if (!await (window as any).ethereum._metamask.isUnlocked()) this.call('notification', 'toast', 'Please make sure the injected provider is unlocked (e.g Metamask).')
await addL2Network(this.chainName, this.chainId, this.rpcUrls)
const resultData = await this.provider.currentProvider.send(data.method, data.params)

@ -43,8 +43,7 @@ export class ExecutionContext {
}
askPermission () {
// metamask
if (ethereum && typeof ethereum.enable === 'function') ethereum.enable()
if (ethereum && typeof ethereum.request === "function") ethereum.request({ method: "eth_requestAccounts" });
}
getProvider () {

Loading…
Cancel
Save