Users of Keplr Mobile were experiencing an error when connecting their wallet from the web browser inside the app,
so I made this change to fix it.
Reasons for the change
I think what you meant to do was to show the presence of window.keplr via the mobileDisabled value.
// In the Keplr Mobile in-app browser, Keplr is available in window.keplr,
// similar to the extension on a desktop browser. For this reason, we must
// check what mode the window.keplr client is in once it's available.
mobileDisabled: () =>
!(
typeof document !== 'undefined' &&
document.readyState === 'complete' &&
(window as KeplrWindow).keplr &&
(window as KeplrWindow).keplr.mode === 'mobile-web'
),
However, if there are two connection buttons, Keplr and Keplr Mobile, most users will connect to WC by pressing the Keplr Mobile button.
If you look at the services developed now, most of them only show the Keplr Mobile button as shown in the screenshot below.
What changed.
wallets/keplr-mobile/src/wallet-connect/main-wallet.ts
Added specifying Keplr Extension Client as the client if window.keplr exists.
Overview
Users of Keplr Mobile were experiencing an error when connecting their wallet from the web browser inside the app, so I made this change to fix it.
Reasons for the change
I think what you meant to do was to show the presence of
window.keplr
via themobileDisabled
value.However, if there are two connection buttons,
Keplr
andKeplr Mobile
, most users will connect to WC by pressing theKeplr Mobile
button.If you look at the services developed now, most of them only show the
Keplr Mobile
button as shown in the screenshot below.What changed.
wallets/keplr-mobile/src/wallet-connect/main-wallet.ts
Added specifyingKeplr Extension Client
as the client ifwindow.keplr
exists.~~I extracted the part of
getKeplrFromExtension
that returnsClientNotExistError
to the outside. This is the original Keplr code (https://github.com/chainapsis/keplr-wallet/blob/master/packages/stores/src/account/get-keplr.ts)~~