-
Notifications
You must be signed in to change notification settings - Fork 604
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
Don't throw when grabbing injected provider #1321
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Review Error for nateReiners @ 2024-06-21 20:31:14 UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -61,10 +61,13 @@ export function getCoinbaseInjectedProvider({ | |||
} | |||
} | |||
|
|||
const ethereum = window.ethereum ?? window.top?.ethereum; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about creating a dedicated function or something to do just this and catch error?
the if statement below doesn’t throw error anyway.
Summary
window.top may throw DOMException, we should not let this error blocking us from continuing
How did you test your changes?