From 25b7a930fb70cfde547cee91b703ebeead7e6a18 Mon Sep 17 00:00:00 2001 From: primata Date: Thu, 22 May 2025 15:23:31 -0300 Subject: [PATCH 1/2] feat: clean wallet list --- src/components/WalletModal.tsx | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/components/WalletModal.tsx b/src/components/WalletModal.tsx index 95bb86afd..71263b6e6 100644 --- a/src/components/WalletModal.tsx +++ b/src/components/WalletModal.tsx @@ -55,7 +55,7 @@ export default function WalletsModal({ const [expanded, setExpanded] = useState(false); const { wallets = [] } = useWallet(); - + const { /** Wallets that use social login to create an account on the blockchain */ aptosConnectWallets, @@ -73,8 +73,25 @@ export default function WalletsModal({ if (sortDefaultWallets) defaultWallets.sort(sortDefaultWallets); if (sortMoreWallets) moreWallets.sort(sortMoreWallets); - const hasAptosConnectWallets = !!aptosConnectWallets.length; + function cleanWalletList(wallets: AnyAptosWallet[]) { + const unsupportedWallets = ['Dev T wallet', 'Pontem', 'TrustWallet', 'TokenPocket', 'Martian', 'Rise'] + return wallets + .filter( + (wallet, index, self) => + self.findIndex((w) => w.name === wallet.name) === index, + ) + .filter((wallet) => { + console.log(wallet.name) + if (!wallet) return false; + if (unsupportedWallets.includes(wallet.name)) { + return false; + } + return wallet; + }); + } + const hasAptosConnectWallets = !!aptosConnectWallets.length; + return ( )}*/} - {defaultWallets.map((wallet: AnyAptosWallet) => ( + {cleanWalletList(defaultWallets).map((wallet: AnyAptosWallet) => ( - {moreWallets.map((wallet: AnyAptosWallet) => ( + {cleanWalletList(moreWallets).map((wallet: AnyAptosWallet) => ( Date: Thu, 22 May 2025 15:26:58 -0300 Subject: [PATCH 2/2] remove log --- src/components/WalletModal.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/WalletModal.tsx b/src/components/WalletModal.tsx index 71263b6e6..0aae57583 100644 --- a/src/components/WalletModal.tsx +++ b/src/components/WalletModal.tsx @@ -81,7 +81,6 @@ export default function WalletsModal({ self.findIndex((w) => w.name === wallet.name) === index, ) .filter((wallet) => { - console.log(wallet.name) if (!wallet) return false; if (unsupportedWallets.includes(wallet.name)) { return false;