Skip to content

Commit 2835956

Browse files
committed
feat: hides admin wallets if smart wallets are in use
1 parent 277c2e2 commit 2835956

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.changeset/yummy-tires-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": minor
3+
---
4+
5+
Hides admin wallets if smart wallets are in use

packages/thirdweb/src/wallets/manager/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ export function createConnectionManager(storage: AsyncStorage) {
8383
const isAutoConnecting = createStore(false);
8484

8585
const connectedWallets = computedStore(() => {
86-
return Array.from(walletIdToConnectedWalletMap.getValue().values());
86+
const allWallets = Array.from(
87+
walletIdToConnectedWalletMap.getValue().values(),
88+
);
89+
const hasSmartWallet = allWallets.some((w) => isSmartWallet(w));
90+
return hasSmartWallet
91+
? allWallets.filter((w) => w.id !== "inApp")
92+
: allWallets;
8793
}, [walletIdToConnectedWalletMap]);
8894

8995
// actions

0 commit comments

Comments
 (0)