Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #13642: Cannot sign in on claim.lens.xyz #13668

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion resources/js/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}))
}});
Comment on lines +194 to +198
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you are using setTimeout to throw the error, so that it shouldn't stop the current js thread. Please can you explain, what is the benefit of doing that, can we just use an empty block here?

}
EthereumProvider.prototype.enable = function () {
if (window.statusAppDebug) { console.log("enable"); }
Expand Down