From 61cb54fb8e1358fe4a13a3d8330817436e29bbc0 Mon Sep 17 00:00:00 2001 From: frank Date: Fri, 15 Jul 2022 14:02:33 +0800 Subject: [PATCH] fixes #13642: Cannot sign in on claim.lens.xyz Signed-off-by: Parvesh Monu --- resources/js/provider.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/js/provider.js b/resources/js/provider.js index fa3ede6fa7..d455adf4ad 100644 --- a/resources/js/provider.js +++ b/resources/js/provider.js @@ -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"); }