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

Update inpage-metamask.js #4

Closed
wants to merge 1 commit into from

Conversation

nikbenesh
Copy link

Added some error handling for better safety

Added some error handling for better safety
@nikbenesh nikbenesh requested a review from jmrossy as a code owner December 20, 2024 08:24
Copy link

vercel bot commented Dec 20, 2024

@nikbenesh is attempting to deploy a commit to the Abacus Works Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@jmrossy jmrossy left a 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

Comment on lines -1 to -2
// Copied from https://github.com/WalletConnect/web3modal/pull/614/files
// But updated to use newer packages
Copy link
Collaborator

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

Comment on lines +6 to +8
const isMetaMaskAvailable = () => {
return typeof window !== 'undefined' && (window.ethereum || window.web3);
};
Copy link
Collaborator

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);
Copy link
Collaborator

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

@jmrossy jmrossy closed this Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants