Unnecessary duplication removed

This commit is contained in:
Volodymyr Kozieiev 2024-08-18 13:41:03 +01:00
parent f62afdac16
commit c7bd607c5a
No known key found for this signature in database
GPG Key ID: 82B04968DF4C0535
2 changed files with 6 additions and 26 deletions

View File

@ -320,18 +320,6 @@
(let [counter (count address)]
(str (subs address 0 6) "\u2026" (subs address (- counter 3) counter)))))
(defn make-limit-label-crypto
[amount currency]
(str amount
" "
(some-> currency
name
string/upper-case)))
(defn make-limit-label-fiat
[amount currency-symbol]
(str currency-symbol amount))
(defn get-account-name-error
[s existing-account-names]
(cond

View File

@ -191,19 +191,12 @@
current-crypto-limit
current-fiat-limit)
input-value (controlled-input/input-value input-state)
valid-input? (not (or (string/blank? input-value)
(<= (controlled-input/numeric-value
input-state)
0)
(> (controlled-input/numeric-value
input-state)
current-limit)))
input-num-value (controlled-input/numeric-value input-state)
valid-input? (not (or (controlled-input/empty-value? input-state)
(controlled-input/input-error input-state)))
confirm-disabled? (or (nil? route)
(empty? route)
(string/blank? input-value)
(<= input-num-value 0)
(> input-num-value current-limit))
(not valid-input?))
amount-in-crypto (if crypto-currency?
input-value
(number/remove-trailing-zeroes
@ -344,9 +337,8 @@
:title (i18n/label
:t/send-limit
{:limit (if crypto-currency?
(utils/make-limit-label-crypto current-limit token-symbol)
(utils/make-limit-label-fiat current-limit
currency-symbol))})
(utils/prettify-crypto-balance token-symbol (money/bignumber current-limit) conversion-rate)
(utils/prettify-balance currency-symbol (money/bignumber current-limit)))})
:status (when (controlled-input/input-error input-state) :error)}]}]
[routes/view
{:token token-by-symbol