diff --git a/components/dialogs/transfer/transfer-dialog.tsx b/components/dialogs/transfer/transfer-dialog.tsx index a91c8e30..25b8249e 100644 --- a/components/dialogs/transfer/transfer-dialog.tsx +++ b/components/dialogs/transfer/transfer-dialog.tsx @@ -337,6 +337,18 @@ function TransferForm({ const { setSide } = useSide() async function onSubmit(values: z.infer) { + const isAmountSufficient = checkAmount( + queryClient, + values.amount, + baseToken, + ) + if (!isAmountSufficient) { + form.setError("amount", { + message: `Amount must be greater than or equal to ${MIN_DEPOSIT_AMOUNT} USDC`, + }) + return + } + if (direction === ExternalTransferDirection.Deposit) { await checkChain() const isBalanceSufficient = checkBalance({ @@ -350,17 +362,6 @@ function TransferForm({ }) return } - const isAmountSufficient = checkAmount( - queryClient, - values.amount, - baseToken, - ) - if (!isAmountSufficient) { - form.setError("amount", { - message: `Amount must be greater than or equal to ${MIN_DEPOSIT_AMOUNT} USDC`, - }) - return - } if (needsApproval) { handleApprove({ onSuccess: () => {