wallet-adapter icon indicating copy to clipboard operation
wallet-adapter copied to clipboard

Clicking "get started" doesn't do anything when there are no installed wallets

Open driescroons opened this issue 3 years ago • 8 comments
trafficstars

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.

image

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:

  1. Open an incognito tab
  2. Go to https://solana-labs.github.io/wallet-adapter/example/
  3. Click on 'Select Wallet' in the 'React UI column'
  4. When the popup opens, click "get started"
  5. Notice the modal just closes

Expected behavior The "get started" button should redirect us to the first / a default adapter's wallet installation page.

driescroons avatar Apr 23 '22 13:04 driescroons

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?

jordaaash avatar Apr 23 '22 14:04 jordaaash

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

safaiyeh avatar Apr 26 '22 16:04 safaiyeh

The prop I added was an optional field, if not set it uses the internal logic there

safaiyeh avatar Apr 26 '22 16:04 safaiyeh

@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.

jordaaash avatar Apr 28 '22 17:04 jordaaash

@jordansexton any update here to reconsider the PR? we've been using an internal patch to handle this

safaiyeh avatar Jun 14 '22 20:06 safaiyeh

@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.

wisefool769 avatar Jun 15 '22 20:06 wisefool769

+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.

taycaldwell avatar Aug 04 '22 21:08 taycaldwell

We need this feature too, at least a props when the user click wallet is mandatory

nmaddp1995 avatar Aug 29 '22 16:08 nmaddp1995

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.

jordaaash avatar Oct 19 '22 03:10 jordaaash

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.

jordaaash avatar Oct 19 '22 03:10 jordaaash

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.

jordaaash avatar Dec 21 '22 16:12 jordaaash