Skip to content

Commit

Permalink
fix(swap): reselect primary token to sell when no buy token is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed Oct 13, 2023
1 parent 24b8dcc commit 5c9a949
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ type SelectableTokenProps = {disabled?: boolean; tokenInfo: Balance.TokenInfo; w
const SelectableToken = ({tokenInfo, wallet}: SelectableTokenProps) => {
const {closeSearch} = useSearch()
const {sellTokenIdChanged, orderData} = useSwap()
const {sellTouched} = useSwapTouched()
const {sellTouched, isBuyTouched} = useSwapTouched()
const navigateTo = useNavigateTo()
const {track} = useMetrics()

const balanceAvailable = useBalance({wallet, tokenId: tokenInfo.id})
const isDisabled = tokenInfo.id === orderData.amounts.buy.tokenId
const isDisabled = tokenInfo.id === orderData.amounts.buy.tokenId && isBuyTouched

const handleOnTokenSelection = () => {
track.swapAssetFromChanged({
Expand Down

0 comments on commit 5c9a949

Please sign in to comment.