-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update inpage-metamask.js #4
Conversation
Added some error handling for better safety
@nikbenesh is attempting to deploy a commit to the Abacus Works Team on Vercel. A member of the Team first needs to authorize it. |
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.
Thanks for the PR but it's preferable to keep the code in src/vendor
as close to it's upstream source as possible. 'vendor' in this context means 3rd party but inlined for performance, bundle-size, or security reasons
// Copied from https://github.com/WalletConnect/web3modal/pull/614/files | ||
// But updated to use newer packages |
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.
This comment was kept intentionally, this is useful information
const isMetaMaskAvailable = () => { | ||
return typeof window !== 'undefined' && (window.ethereum || window.web3); | ||
}; |
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.
This code isn't used anywhere else, why pull it out into a function?
shouldShimWeb3: true, | ||
}); | ||
} catch (error) { | ||
console.error('Failed to initialize MetaMask provider:', error); |
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.
this app's convention is to use logger
Added some error handling for better safety