Open jordaaash opened 1 year ago
@jordansexton is attempting to deploy a commit to the blockworks-foundation Team on Vercel.
A member of the Team first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
mango-ui-v3-devnet | ✅ Ready (Inspect) | Visit Preview | Oct 23, 2022 at 0:58AM (UTC) |
mango-ui-v3-testnet | ✅ Ready (Inspect) | Visit Preview | Oct 23, 2022 at 0:58AM (UTC) |
Updated to the latest RC of wallet-adapter-react. No functional changes for dapps, just makes how wallets are detected on the window more robust.
Maybe don't review just yet, still making some internal changes. This won't affect you, but want to avoid spamming you with new RCs.
We're at RC 9, which looks likely to be the last RC. This now updates Mango to use the latest RC. I'll follow up once we hit full release. There are no functional changes for apps with this update. It makes how wallets attach to the window more robust.
i just tried your changes locally on devnet yarn devnet
sollet.io
was opened in a new window:@mschneider thanks for the repro steps, will try this. What version of node are you on so I can run the same?
17.4
In this PR we upgrade
@solana/wallet-adapter-react
and replace a modifiedWalletProvider
and various hooks. The main benefit of doing so is that Mango gets the following for free:You can read much more about the wider effort to upgrade the entire ecosystem of Solana web apps at: https://github.com/solana-labs/wallet-adapter/issues/604
Approach
Mango's UI makes use of a custom
WalletProvider
context provider implementation. This copies many behaviors from the one in@solana/wallet-adapter-react
, but removes the clearing of wallets on disconnection and errors. Because the stock@solana/wallet-adapter-react
WalletProvider
is needed to get the above benefits, we restore it in this PR.However, we extend this with a custom child provider that implements the behavior that Mango's UI currently has, of preselecting the first displayed wallet, remembering it, and displaying it in the connect button. In this way, we're able to keep what I think is the desired behavior, while restoring auto-connect functionality that improves the UX on desktop and especially on mobile using Mobile Wallet Adapter.
I've (manually, but heavily) tested connect, disconnect, wallet switching, error handling, autoconnect, and account viewing on desktop with multiple wallets. I didn't test transactions in Mango because the UI is currently warned to be non-functional.
Screenshots
Wallet Menu
Backpack and Glow, both Standard Wallets, are detected without using adapters. Glow's adapter is included in the code, but the Standard Wallet is used instead, without duplication.
Connected Wallet
Backpack, a Standard Wallet, is shown connected to Mango without using an adapter.