wallet-adapter
wallet-adapter copied to clipboard
Clicking "get started" doesn't do anything when there are no installed wallets
Describe the bug When you open a react app with the wallet-adapter in an incognito tab (assuming you have no wallet extensions enabled), and click the "Select Wallet" (WalletMultiButton), a popup shows up.

As you can see, I have no wallets installed, and when I click "get started", the popup just closes as there is no installed wallet found. Should we be able to pass a default adapter? When pressing "get started", we could redirect the user to the installation page of the passed adapter.
This could've also been a feature request, but I felt like the "get started" button closing the modal without any action is a bug, even though you can click the WalletMultiButton again.
If this seems like a nice feature, I can create a PR.
To Reproduce Steps to reproduce the behavior:
- Open an incognito tab
- Go to https://solana-labs.github.io/wallet-adapter/example/
- Click on 'Select Wallet' in the 'React UI column'
- When the popup opens, click "get started"
- Notice the modal just closes
Expected behavior The "get started" button should redirect us to the first / a default adapter's wallet installation page.
Hmm, this sounds like a bug. It's not specifically necessary to pass a default adapter -- it should be trying to use Torus (doesn't require installing a plugin), Phantom (most common), or the first one you provide: https://github.com/solana-labs/wallet-adapter/blob/a827686dbc109ef43b5da0031811cb5013aaaac8/packages/ui/react-ui/src/WalletModal.tsx#L44
There was an effort in https://github.com/solana-labs/wallet-adapter/pull/381 to add a default wallet, but I'd rather fix this without adding another prop, which would also require everyone using it now to upgrade and make code changes to get the fix.
Can you see what's causing this?
Hmm, this sounds like a bug. It's not specifically necessary to pass a default adapter -- it should be trying to use Torus (doesn't require installing a plugin), Phantom (most common), or the first one you provide:
https://github.com/solana-labs/wallet-adapter/blob/a827686dbc109ef43b5da0031811cb5013aaaac8/packages/ui/react-ui/src/WalletModal.tsx#L44
There was an effort in #381 to add a default wallet, but I'd rather fix this without adding another prop, which would also require everyone using it now to upgrade and make code changes to get the fix.
Can you see what's causing this?
My motivation is that we want to show Phantom's onboarding by default rather than Torus's
The prop I added was an optional field, if not set it uses the internal logic there
@safaiyeh thanks for the context. I may revisit your PR. I think we shouldn't favor any particular wallet or have their names hardcoded into this anyway.
@jordansexton any update here to reconsider the PR? we've been using an internal patch to handle this
@jordansexton PR 381 would be useful for us as well. If a user doesn't have any pre-existing Solana wallets installed, it would be great for applications to be able to funnel them in a particular direction -- while maintaining support for everything including Torus and Phantom.
+1 being able to specify a default wallet or redirect the users to a specific wallet of the developers choice would be useful.
Hardcoding to be Torus > Phantom seems too opinionated.
We need this feature too, at least a props when the user click wallet is mandatory
Hardcoding to be Torus > Phantom seems too opinionated.
Fully agree with this. Thanks for your patience on this issue everyone. We will revamp this UX, remove the opinionated selection, and make it configurable.
I've reopened @safaiyeh's PR https://github.com/solana-labs/wallet-adapter/pull/381 to provide a basis for this. In light of the general move to Mobile Wallet Adapter and Wallet Standard support (#598) the solution might be different now, but we'll find something workable for various use cases.
The getting started button was removed in https://github.com/solana-labs/wallet-adapter/pull/680, and any "default" wallets were removed previously. Now the order is strictly consistent between the UI packages.