From 2ac65cb4c185139db7e2790942359a309c656d54 Mon Sep 17 00:00:00 2001 From: Alexander Kolberg Date: Fri, 3 Oct 2025 23:31:50 +0300 Subject: [PATCH] Attempt to fix swap from native --- .../Checkout/PaymentMethodSelect/PayWithCrypto/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/checkout/src/views/Checkout/PaymentMethodSelect/PayWithCrypto/index.tsx b/packages/checkout/src/views/Checkout/PaymentMethodSelect/PayWithCrypto/index.tsx index f781759cd..9e87dfada 100644 --- a/packages/checkout/src/views/Checkout/PaymentMethodSelect/PayWithCrypto/index.tsx +++ b/packages/checkout/src/views/Checkout/PaymentMethodSelect/PayWithCrypto/index.tsx @@ -81,7 +81,9 @@ export const PayWithCryptoTab = ({ skipOnCloseCallback, isSwitchingChainRef }: P chainId: chain } + // Check if the target currency (what the item is priced in) is native const isNativeToken = compareAddress(currencyAddress, zeroAddress) + // Check if the selected currency (what the user is paying with) is native const isNativeTokenSelectedCurrency = compareAddress(selectedCurrency.address, zeroAddress) const { data: tokenBalancesData, isLoading: tokenBalancesIsLoading } = useGetTokenBalancesSummary({ @@ -163,14 +165,14 @@ export const PayWithCryptoTab = ({ skipOnCloseCallback, isSwitchingChainRef }: P address: currencyAddress as Hex, args: [userAddress, approvedSpenderAddress || targetContractAddress], query: { - enabled: !!userAddress && !isNativeTokenSelectedCurrency + enabled: !!userAddress && !isNativeToken } }) const isLoading = isLoadingCoinPrice || isLoadingCurrencyInfo || - (allowanceIsLoading && !isNativeTokenSelectedCurrency) || + (allowanceIsLoading && !isNativeToken) || isLoadingSwapQuote || tokenBalancesIsLoading || isLoadingSelectedCurrencyInfo @@ -352,7 +354,7 @@ export const PayWithCryptoTab = ({ skipOnCloseCallback, isSwitchingChainRef }: P : {}) }, // Actual transaction optional approve step - ...(isApproved || isNativeTokenSelectedCurrency + ...(isApproved || isNativeToken ? [] : [ {