Skip to content

Commit

Permalink
feat: support cosmostation mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
soaryong-stamper committed Dec 18, 2023
1 parent 9f0ceca commit 4efe8f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/web/config/wallet-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const WalletRegistry: RegistryWallet[] = [
{
...CosmosKitWalletList["cosmostation-extension"],
logo: "/wallets/cosmostation.png",
mobileDisabled: false,
lazyInstall: () =>
import("@cosmos-kit/cosmostation-extension").then(
(m) => m.CosmostationExtensionWallet
Expand Down
16 changes: 16 additions & 0 deletions packages/web/modals/wallet-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,22 @@ const LeftModalContent: FunctionComponent<
.map((wallet) => ({ ...wallet, mobileDisabled: false }));
}

/**
* If on mobile and `cosmostation` is in `window`, it means that the user enters
* the frontend from Cosmostation's app in app browser. So, there is no need
* to use wallet connect, as it resembles the extension's usage.
*/
if (
_window?.cosmostation &&
_window?.cosmostation?.mode === mobileWebModeName
) {
return array
.filter(
(wallet) => wallet.name === AvailableWallets.Cosmostation
)
.map((wallet) => ({ ...wallet, mobileDisabled: false }));
}

/**
* If user is in a normal mobile browser, show only wallet connect
*/
Expand Down

0 comments on commit 4efe8f5

Please sign in to comment.