From f19e3c3b88dce8ed60b981094e8ff02fc024826e Mon Sep 17 00:00:00 2001 From: Jhonatan Gonzalez Date: Fri, 15 Mar 2024 19:16:43 +0900 Subject: [PATCH] delay query to smart checkout if no token address --- .../src/widgets/sale/views/FundWithSmartCheckout.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/checkout/widgets-lib/src/widgets/sale/views/FundWithSmartCheckout.tsx b/packages/checkout/widgets-lib/src/widgets/sale/views/FundWithSmartCheckout.tsx index fbcaea02a4..2ce1cb699b 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/views/FundWithSmartCheckout.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/views/FundWithSmartCheckout.tsx @@ -32,7 +32,7 @@ export function FundWithSmartCheckout({ subView }: FundWithSmartCheckoutProps) { >(undefined); const [fundingRouteStepIndex, setFundingRouteStepIndex] = useState(0); const { - querySmartCheckout, fundingRoutes, smartCheckoutResult, collectionName, + querySmartCheckout, fundingRoutes, smartCheckoutResult, collectionName, fromTokenAddress, } = useSaleContext(); const { cryptoFiatDispatch } = useContext(CryptoFiatContext); @@ -41,9 +41,9 @@ export function FundWithSmartCheckout({ subView }: FundWithSmartCheckoutProps) { }; useEffect(() => { - if (subView !== FundWithSmartCheckoutSubViews.INIT) return; + if (subView !== FundWithSmartCheckoutSubViews.INIT || !fromTokenAddress) return; querySmartCheckout(); - }, [subView]); + }, [subView, fromTokenAddress]); useEffect(() => { if (!cryptoFiatDispatch || !smartCheckoutResult) return;