Skip to content

Commit

Permalink
fix(limit): show price impact warning for Safe App when bundling (#3571)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfetopito authored Jan 9, 2024
1 parent 246db74 commit 98a11e7
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export function LimitOrdersWarnings(props: LimitOrdersWarningsProps) {
const tradeQuote = useTradeQuote()
const priceImpactParams = useTradePriceImpact()

const canTrade = localFormValidation === null && primaryFormValidation === null && !tradeQuote.error
const isBundling = primaryFormValidation && FORM_STATES_TO_SHOW_BUNDLE_BANNER.includes(primaryFormValidation)

const canTrade = localFormValidation === null && (primaryFormValidation === null || isBundling) && !tradeQuote.error
const showPriceImpactWarning =
canTrade && !expertMode && !!account && !priceImpactParams.loading && !priceImpactParams.priceImpact

Expand All @@ -84,8 +86,7 @@ export function LimitOrdersWarnings(props: LimitOrdersWarningsProps) {

const showHighFeeWarning = feePercentage?.greaterThan(HIGH_FEE_WARNING_PERCENTAGE)

const showApprovalBundlingBanner =
!isConfirmScreen && primaryFormValidation && FORM_STATES_TO_SHOW_BUNDLE_BANNER.includes(primaryFormValidation)
const showApprovalBundlingBanner = !isConfirmScreen && isBundling
const shouldZeroApprove = useShouldZeroApprove(slippageAdjustedSellAmount)
const showZeroApprovalWarning = shouldZeroApprove && outputCurrency !== null // Show warning only when output currency is also present.

Expand Down

0 comments on commit 98a11e7

Please sign in to comment.