File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed
apps/cowswap-frontend/src
modules/tradeFormValidation/services Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -3598,7 +3598,7 @@ msgstr "CoW Protocol covers the fees and costs by executing your order at a slig
35983598
35993599#: apps/cowswap-frontend/src/modules/hooksStore/containers/HooksStoreWidget/index.tsx
36003600msgid "With hooks you can add specific actions <0>before</0> and <1>after</1> your swap."
3601- msgstr "With hooks you can add specific actions <0>before</0> and <1>after</1> your swap.<<<<<<< Updated upstream "
3601+ msgstr "With hooks you can add specific actions <0>before</0> and <1>after</1> your swap."
36023602
36033603#: apps/cowswap-frontend/src/modules/tokensList/hooks/useRestrictedTokenImportStatus.ts
36043604#: apps/cowswap-frontend/src/modules/tokensList/hooks/useRestrictedTokensImportStatus.ts
Original file line number Diff line number Diff line change @@ -103,6 +103,20 @@ export function validateTradeForm(context: TradeFormValidationContext): TradeFor
103103 validations . push ( TradeFormValidation . InputAmountNotSet )
104104 }
105105
106+ if ( ! canPlaceOrderWithoutBalance && ! ! account ) {
107+ if ( ! inputCurrencyBalance && isBalancesLoading ) {
108+ validations . push ( TradeFormValidation . BalancesLoading )
109+ }
110+
111+ if ( ! inputCurrencyBalance && ! isBalancesLoading ) {
112+ validations . push ( TradeFormValidation . BalancesNotLoaded )
113+ }
114+
115+ if ( inputCurrencyBalance && inputCurrencyAmount && inputCurrencyBalance . lessThan ( inputCurrencyAmount ) ) {
116+ validations . push ( TradeFormValidation . BalanceInsufficient )
117+ }
118+ }
119+
106120 if ( ! isWrapUnwrap ) {
107121 const isRecipientAddress = Boolean ( recipient && isAddress ( recipient ) )
108122
@@ -119,20 +133,6 @@ export function validateTradeForm(context: TradeFormValidationContext): TradeFor
119133 validations . push ( TradeFormValidation . CurrencyNotSupported )
120134 }
121135
122- if ( ! canPlaceOrderWithoutBalance && ! ! account ) {
123- if ( ! inputCurrencyBalance && isBalancesLoading ) {
124- validations . push ( TradeFormValidation . BalancesLoading )
125- }
126-
127- if ( ! inputCurrencyBalance && ! isBalancesLoading ) {
128- validations . push ( TradeFormValidation . BalancesNotLoaded )
129- }
130-
131- if ( inputCurrencyBalance && inputCurrencyAmount && inputCurrencyBalance . lessThan ( inputCurrencyAmount ) ) {
132- validations . push ( TradeFormValidation . BalanceInsufficient )
133- }
134- }
135-
136136 if ( isFastQuote || ! tradeQuote . quote || ( isBridging && tradeQuote . isLoading ) ) {
137137 validations . push ( TradeFormValidation . QuoteLoading )
138138 }
You can’t perform that action at this time.
0 commit comments