Skip to content

Commit

Permalink
fix: hide toolbar when insufficient liquidity (#558)
Browse files Browse the repository at this point in the history
* fix: hide toolbar when insufficient liquidity

* fix: remove ternary
  • Loading branch information
just-toby authored Mar 14, 2023
1 parent 771e41f commit e3c9a20
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/Swap/Toolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ function CaptionRow() {
}
}

if (state === TradeState.INVALID || state === TradeState.NO_ROUTE_FOUND) {
if (state === TradeState.INVALID) {
return { caption: <Caption.Error /> }
}
if (state === TradeState.NO_ROUTE_FOUND) {
return { caption: null }
}
}

return { caption: <Caption.MissingInputs /> }
Expand Down Expand Up @@ -146,7 +149,7 @@ function CaptionRow() {
return rows
}, [gasUseEstimateUSD, impact, slippage, trade])

if (inputCurrency == null || outputCurrency == null || error === ChainError.MISMATCHED_CHAINS) {
if (inputCurrency == null || outputCurrency == null || error === ChainError.MISMATCHED_CHAINS || caption === null) {
return null
}
return (
Expand Down

1 comment on commit e3c9a20

@vercel
Copy link

@vercel vercel bot commented on e3c9a20 Mar 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

widgets – ./

widgets-seven-tau.vercel.app
widgets-git-main-uniswap.vercel.app
widgets-uniswap.vercel.app

Please sign in to comment.