diff --git a/packages/web/hooks/one-click-trading/use-one-click-trading-swap-review.ts b/packages/web/hooks/one-click-trading/use-one-click-trading-swap-review.ts index 29859bc342..e9650962e7 100644 --- a/packages/web/hooks/one-click-trading/use-one-click-trading-swap-review.ts +++ b/packages/web/hooks/one-click-trading/use-one-click-trading-swap-review.ts @@ -296,6 +296,7 @@ function useOneClickRemainingSpendLimit({ wantToSpend: Dec; maybeWouldSpendTotal?: Dec; }) => { + if (!enabled) return false; if (wantToSpend.isZero()) return false; const spendLimit = transactionParams?.spendLimit?.toDec() ?? new Dec(0); @@ -309,7 +310,7 @@ function useOneClickRemainingSpendLimit({ return wouldSpend.gt(spendLimit); }, - [amountSpentData, transactionParams] + [amountSpentData?.amountSpent, enabled, transactionParams?.spendLimit] ); return { diff --git a/packages/web/modals/review-order.tsx b/packages/web/modals/review-order.tsx index 520611f8e2..4b97b6d78b 100644 --- a/packages/web/modals/review-order.tsx +++ b/packages/web/modals/review-order.tsx @@ -132,11 +132,18 @@ export function ReviewOrder({ } = useOneClickTradingSwapReview({ isModalOpen: isOpen }); const wouldExceedSpendLimit = useMemo(() => { + if (!is1CTEnabled) return false; + return wouldExceedSpendLimit1CT({ wantToSpend: fiatAmountWithSlippage?.toDec() ?? new Dec(0), maybeWouldSpendTotal: overspendErrorParams?.wouldSpendTotal, }); - }, [overspendErrorParams, fiatAmountWithSlippage, wouldExceedSpendLimit1CT]); + }, [ + is1CTEnabled, + wouldExceedSpendLimit1CT, + fiatAmountWithSlippage, + overspendErrorParams?.wouldSpendTotal, + ]); const [orderType] = useQueryState( "type",