Skip to content

Commit

Permalink
fix: confusing quote un/select behaviour (#8864)
Browse files Browse the repository at this point in the history
* fix: confusing quote un/select behaviour

* fix: lint
  • Loading branch information
gomesalexandre authored Feb 19, 2025
1 parent 29508ee commit bffce37
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,9 @@ export const TradeQuote: FC<TradeQuoteProps> = memo(
)

const handleQuoteSelection = useCallback(() => {
if (!isActive) {
dispatch(tradeQuoteSlice.actions.setActiveQuote(quoteData))
onBack && onBack()
} else if (!isBest) {
// don't allow un-selecting of best quote as it gets re-selected in this case
dispatch(tradeQuoteSlice.actions.setActiveQuote(undefined))
}
}, [dispatch, isActive, isBest, onBack, quoteData])
dispatch(tradeQuoteSlice.actions.setActiveQuote(quoteData))
onBack && onBack()
}, [dispatch, onBack, quoteData])

const feeAsset = useAppSelector(state =>
selectFeeAssetByChainId(state, sellAsset.chainId ?? ''),
Expand Down

0 comments on commit bffce37

Please sign in to comment.