From 7561743149aed70084b5a17acd25c555bfa07d03 Mon Sep 17 00:00:00 2001 From: vkulinich Date: Thu, 12 Dec 2024 16:20:16 +0100 Subject: [PATCH] fix --- .../modals/AddLiquidity/AddLiquidityFormXYK.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/sections/pools/modals/AddLiquidity/AddLiquidityFormXYK.tsx b/src/sections/pools/modals/AddLiquidity/AddLiquidityFormXYK.tsx index d563ff45c..07cc5e050 100644 --- a/src/sections/pools/modals/AddLiquidity/AddLiquidityFormXYK.tsx +++ b/src/sections/pools/modals/AddLiquidity/AddLiquidityFormXYK.tsx @@ -1,4 +1,4 @@ -import { Controller, useForm } from "react-hook-form" +import { Controller, FieldErrors, useForm } from "react-hook-form" import BN from "bignumber.js" import { BN_0, BN_1 } from "utils/constants" import { WalletTransferAssetSelect } from "sections/wallet/transfer/WalletTransferAssetSelect" @@ -168,6 +168,15 @@ export const AddLiquidityFormXYK = ({ pool, onClose, onSuccess }: Props) => { ) } + const onInvalidSubmit = (errors: FieldErrors) => { + if ( + !isJoinFarms && + (errors.shares as { farm?: { message: string } }).farm + ) { + onSubmit() + } + } + const handleChange = useCallback( (value: string, name: "assetA" | "assetB") => { const assetDecimals = assetValues[name].meta.decimals @@ -245,7 +254,7 @@ export const AddLiquidityFormXYK = ({ pool, onClose, onSuccess }: Props) => { return (