From 64474f30461ecb0210a85c3e0a7175ade7a3bb52 Mon Sep 17 00:00:00 2001 From: LukassF Date: Wed, 28 Feb 2024 11:32:10 +0100 Subject: [PATCH] fix: polkadot detection v2 --- sdk/packages/selector-polkadot/src/detection.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/sdk/packages/selector-polkadot/src/detection.ts b/sdk/packages/selector-polkadot/src/detection.ts index 802d8d3f..30615deb 100644 --- a/sdk/packages/selector-polkadot/src/detection.ts +++ b/sdk/packages/selector-polkadot/src/detection.ts @@ -58,23 +58,17 @@ export const getPolkadotWalletsList = (presetList: WalletMetadata[], recentWalle // by namespace if (walletsData[wallet.slug.toLocaleLowerCase()]) { walletsData[wallet.slug.toLocaleLowerCase()] = { - ...(walletsData?.[wallet.slug.toLocaleLowerCase()] ?? { - name: wallet.name, - icon: wallet.icon, - link: '', - deeplink: null, - recent: recentWalletName === wallet.name, - walletType: 'hybrid' - }), + ...walletsData?.[wallet.slug.toLocaleLowerCase()], + recent: recentWalletName === wallet.name, detected: true, - injectedWallet: wallet + injectedWallet: wallet, + walletType: 'hybrid' } - continue } // Check if wallet is already in the list // by name - if (walletsData[wallet.name.toLocaleLowerCase()]) { + else if (walletsData[wallet.name.toLocaleLowerCase()]) { walletsData[wallet.name.toLocaleLowerCase()] = { ...walletsData[wallet.name.toLocaleLowerCase()], recent: recentWalletName === wallet.name,