-
Notifications
You must be signed in to change notification settings - Fork 408
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: default wallet when none are enabled #1597
Conversation
Branch preview✅ Deploy successful! |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
const enabledWallets = Object.entries(WALLET_MODULES).filter(([key]) => isWalletSupported(chain.disabledWallets, key)) | ||
|
||
if (enabledWallets.length === 0) { | ||
return [WALLET_MODULES.INJECTED()] |
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.
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.
I think you're thinking too much into it. In practice, no chain will have all wallets disabled, and defaulting to the injected wallet is a quick and pragmatic solution w/o adding too many conditions IMHO.
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.
We should remove MetaMask from the list of wallets that can be disabled when we eventually remove the "legacy" wallet names then.
verified |
What it solves
Resolves #1596
How this PR fixes it
When all wallets are disabled, we pass an empty array to onboard, but it needs at least one wallet. So I made it return the "injected" wallet as a default.
How to test it
Cello has currently 0 wallets enabled in the staging config.