Skip to content

Commit

Permalink
delay query to smart checkout if no token address
Browse files Browse the repository at this point in the history
  • Loading branch information
jhesgodi committed Mar 15, 2024
1 parent d221dc1 commit f19e3c3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function FundWithSmartCheckout({ subView }: FundWithSmartCheckoutProps) {
>(undefined);
const [fundingRouteStepIndex, setFundingRouteStepIndex] = useState<number>(0);
const {
querySmartCheckout, fundingRoutes, smartCheckoutResult, collectionName,
querySmartCheckout, fundingRoutes, smartCheckoutResult, collectionName, fromTokenAddress,
} = useSaleContext();
const { cryptoFiatDispatch } = useContext(CryptoFiatContext);

Expand All @@ -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;
Expand Down

0 comments on commit f19e3c3

Please sign in to comment.