Skip to content

Commit

Permalink
[GASBT-10][Sale Widget] Delay calls to smart checkout until token add…
Browse files Browse the repository at this point in the history
…ress is set (#1593)

Co-authored-by: Mimi Tran <[email protected]>
  • Loading branch information
jhesgodi and mimi-imtbl authored Mar 18, 2024
1 parent 89bd8bd commit 7d735bf
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 7d735bf

Please sign in to comment.