Skip to content

Commit 0892e20

Browse files
authored
fix: display swap quote missing error (#5647)
1 parent 4f7425a commit 0892e20

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

.changeset/common-rabbits-rule.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@venusprotocol/evm": patch
3+
---
4+
5+
fix no swap quote found issue

apps/evm/src/pages/Market/OperationForm/Repay/RepayWithCollateralForm/useForm/useFormValidation.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ const useFormValidation = ({
6565
});
6666
}
6767

68-
if (!collateralAmountTokens?.isGreaterThan(0) || !repaidAmountTokens?.isGreaterThan(0)) {
68+
if (getSwapQuoteError?.code === 'noSwapQuoteFound') {
6969
tmpErrors.push({
70-
code: 'EMPTY_TOKEN_AMOUNT',
70+
code: 'NO_SWAP_QUOTE_FOUND',
71+
message: t('operationForm.error.noSwapQuoteFound'),
7172
});
7273
}
7374

74-
if (getSwapQuoteError?.code === 'noSwapQuoteFound') {
75+
if (!collateralAmountTokens?.isGreaterThan(0) || !repaidAmountTokens?.isGreaterThan(0)) {
7576
tmpErrors.push({
76-
code: 'NO_SWAP_QUOTE_FOUND',
77-
message: t('operationForm.error.noSwapQuoteFound'),
77+
code: 'EMPTY_TOKEN_AMOUNT',
7878
});
7979
}
8080

0 commit comments

Comments
 (0)