Skip to content

Commit 6571b75

Browse files
committed
fix ecosystem for premium
1 parent ec1722b commit 6571b75

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

src/ui/pages/Premium/Premium.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ export function PremiumPage() {
9090
<NavigationTitle
9191
title={
9292
<UnstyledLink
93-
to="/wallet-select"
93+
to={{
94+
pathname: '/wallet-select',
95+
search: `?${new URLSearchParams({
96+
ecosystem: 'evm',
97+
})}`,
98+
}}
9499
title="Change Wallet"
95100
className="parent-hover"
96101
style={{

src/ui/pages/Settings/Settings.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import { getCurrentUser } from 'src/shared/getCurrentUser';
6060
import { useStore } from '@store-unit/react';
6161
import { metaAppState } from 'src/ui/shared/meta-app-state';
6262
import { usePremiumStatus } from 'src/ui/features/premium/getPremiumStatus';
63+
import { isEthereumAddress } from 'src/shared/isEthereumAddress';
6364
import { Security } from '../Security';
6465
import { BackupFlowSettingsSection } from './BackupFlowSettingsSection';
6566
import { PreferencesPage } from './Preferences';
@@ -118,6 +119,9 @@ function SettingsMain() {
118119
useBackgroundKind({ kind: 'white' });
119120

120121
const { hasTestWallet } = useStore(metaAppState);
122+
const evmAddress = currentWallet
123+
? isEthereumAddress(currentWallet.address)
124+
: false;
121125

122126
return (
123127
<PageColumn>
@@ -172,7 +176,7 @@ function SettingsMain() {
172176
</Frame>
173177
<Frame>
174178
<VStack gap={0}>
175-
{isPremium ? (
179+
{isPremium && evmAddress ? (
176180
<FrameListItemLink to="/premium">
177181
<AngleRightRow>
178182
<HStack gap={8} alignItems="center">

src/ui/pages/WalletSelect/WalletSelect.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useMemo } from 'react';
22
import { useMutation, useQuery } from '@tanstack/react-query';
3-
import { useLocation, useNavigate } from 'react-router-dom';
3+
import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';
44
import { FillView } from 'src/ui/components/FillView';
55
import { PageColumn } from 'src/ui/components/PageColumn';
66
import { walletPort } from 'src/ui/shared/channels';
@@ -35,6 +35,8 @@ import { useWalletsMetaByChunks } from 'src/ui/shared/requests/useWalletsMetaByC
3535
import { emitter } from 'src/ui/shared/events';
3636
import { useStaleTime } from 'src/ui/shared/useStaleTime';
3737
import { ViewLoading } from 'src/ui/components/ViewLoading';
38+
import { isMatchForEcosystem } from 'src/shared/wallet/shared';
39+
import type { BlockchainType } from 'src/shared/wallet/classifiers';
3840
import * as styles from './styles.module.css';
3941
import { WalletList } from './WalletList';
4042

@@ -88,6 +90,9 @@ const ZERION_ORIGIN = 'https://app.zerion.io';
8890
export function WalletSelect() {
8991
const navigate = useNavigate();
9092
const { pathname } = useLocation();
93+
const [params] = useSearchParams();
94+
95+
const ecosystem = params.get('ecosystem') as BlockchainType;
9196

9297
const { data: walletGroups, isLoading: isLoadingWalletGroups } = useQuery({
9398
queryKey: ['wallet/uiGetWalletGroups'],
@@ -212,6 +217,9 @@ export function WalletSelect() {
212217
}}
213218
selectedAddress={singleAddress}
214219
showAddressValues={true}
220+
predicate={(wallet) =>
221+
!ecosystem || isMatchForEcosystem(wallet.address, ecosystem)
222+
}
215223
renderItemFooter={({ wallet }) => {
216224
const walletMeta = walletsMeta?.find(
217225
(meta) =>

0 commit comments

Comments
 (0)