Skip to content

Commit 8ba5959

Browse files
committed
feat: exclude IAW if smart wallets are used
1 parent 277c2e2 commit 8ba5959

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.changeset/petite-heads-leave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Hides in-app wallets in the payment widgets if smart wallets are used

packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { ThirdwebClient } from "../../../../../client/client.js";
88
import type { Address } from "../../../../../utils/address.js";
99
import { toUnits } from "../../../../../utils/units.js";
1010
import type { Wallet } from "../../../../../wallets/interfaces/wallet.js";
11+
import { isSmartWallet } from "../../../../../wallets/smart/is-smart-wallet.js";
1112
import { usePaymentMethods } from "../../../../core/hooks/usePaymentMethods.js";
1213
import { useActiveWallet } from "../../../../core/hooks/wallets/useActiveWallet.js";
1314
import { useConnectedWallets } from "../../../../core/hooks/wallets/useConnectedWallets.js";
@@ -244,7 +245,12 @@ export function PaymentSelection({
244245
{currentStep.type === "walletSelection" && (
245246
<WalletFiatSelection
246247
client={client}
247-
connectedWallets={connectedWallets}
248+
// We exclude in-app wallets if smart wallets are being used
249+
connectedWallets={
250+
connectedWallets.some((w) => isSmartWallet(w))
251+
? connectedWallets.filter((w) => w.id !== "inApp")
252+
: connectedWallets
253+
}
248254
onConnectWallet={handleConnectWallet}
249255
onFiatSelected={handleFiatSelected}
250256
onWalletSelected={handleWalletSelected}

0 commit comments

Comments
 (0)