Hi I am having problems to handle the Moralis.enableweb3 error. When the user presses on the button that triggers this function, if the user closes the Metamask notification, my Dapp will get collapsed with this error: “moralis.js:6081 Uncaught (in promise) Error: Cannot execute Moralis.enableWeb3(), as Moralis Moralis.enableWeb3() already has been called, but is not finished yet”.
I am trying to handle it with a try/catch, as I have seen in the forum but when I catch the error I do not know what to code in order finish the request, and enable the user to request the metamask notification once again.
This is what my code looks like:
isWeb3Enable = async () => {
if(Moralis.isWeb3Enabled() == false) {
try{
await Moralis.enableWeb3()
} catch(err){
console.error("Error isWeb3Enable", err)
//here is what i dont know what to type to stop the Dapp from collapsing
}
}
}