fixes #13642: Cannot sign in on claim.lens.xyz

Signed-off-by: Parvesh Monu <parvesh.dhullmonu@gmail.com>
This commit is contained in:
frank 2022-07-15 14:02:33 +08:00 committed by Parvesh Monu
parent db45da3cdb
commit 61cb54fb8e
No known key found for this signature in database
GPG Key ID: F399696520817DE9
1 changed files with 8 additions and 1 deletions

View File

@ -188,7 +188,14 @@
if (!this._events[name]) {
return
}
this._events[name].forEach(cb => cb(data));
this._events[name].forEach(cb => {
// Fixes: https://github.com/status-im/status-react/issues/13642
// Metamask also errors on the same issue, but it's using https://github.com/MetaMask/safe-event-emitter and therefore the dapp still works
try{
cb(data)
} catch(e){
setTimeout((()=>{throw e}))
}});
}
EthereumProvider.prototype.enable = function () {
if (window.statusAppDebug) { console.log("enable"); }