This reverts commit 307a995a50c0ec39c9d4f43937081c67e5e33505.
This commit is contained in:
parent
536a5d99de
commit
ecdbb4a49f
@ -158,16 +158,10 @@ export function useDerivedMintInfo(
|
||||
const { [Field.CURRENCY_A]: currencyAAmount, [Field.CURRENCY_B]: currencyBAmount } = parsedAmounts
|
||||
const [tokenAmountA, tokenAmountB] = [currencyAAmount?.wrapped, currencyBAmount?.wrapped]
|
||||
if (pair && totalSupply && tokenAmountA && tokenAmountB) {
|
||||
try {
|
||||
return pair.getLiquidityMinted(totalSupply, tokenAmountA, tokenAmountB)
|
||||
} catch (error) {
|
||||
if (error.isInsufficientInputAmountError) {
|
||||
return CurrencyAmount.fromRawAmount(pair.liquidityToken, ZERO)
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
return pair.getLiquidityMinted(totalSupply, tokenAmountA, tokenAmountB)
|
||||
} else {
|
||||
return undefined
|
||||
}
|
||||
return undefined
|
||||
}, [parsedAmounts, pair, totalSupply])
|
||||
|
||||
const poolTokenPercentage = useMemo(() => {
|
||||
@ -201,10 +195,6 @@ export function useDerivedMintInfo(
|
||||
error = 'Insufficient ' + currencies[Field.CURRENCY_B]?.symbol + ' balance'
|
||||
}
|
||||
|
||||
if (!liquidityMinted?.greaterThan(ZERO)) {
|
||||
error = `Insufficient input amount`
|
||||
}
|
||||
|
||||
return {
|
||||
dependentField,
|
||||
currencies,
|
||||
|
Loading…
Reference in New Issue
Block a user