I have integrated the MetaMask with Angular and while opening up the MetaMask extension from the code I am getting this error.
Following is my code for opening up the extension. I am calling this function on a click to open MetaMask where its giving that error
MetaMask - RPC Error: Permissions request already pending; please wait. {code: -32002, message: "Permissions request already pending; please wait."}
ethEnabled(template?): any
{
if ((window as any).web3)
{
(window as any).web3 = new Web3((window as any).web3.currentProvider);
(window as any).ethereum.enable();
console.log((window as any).ethereum.enable());
}
else
{
this.modalRef = this.modalService.show(template);
}
}