Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amount input field is highlighted red despite valid amount is entered #19372 #19711

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/status_im/contexts/wallet/send/input_amount/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
[utils.address :as address]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.money :as money]
[utils.re-frame :as rf]))

(defn- make-limit-label
Expand Down Expand Up @@ -84,8 +85,11 @@

(defn- reset-input-error
[new-value prev-value input-error]
(reset! input-error
(> new-value prev-value)))
(let [converted-new-value (money/bignumber new-value)
converted-prev-value (money/bignumber prev-value)]
(when (and converted-new-value converted-prev-value)
(reset! input-error
(money/greater-than converted-new-value converted-prev-value)))))

(defn delete-from-string
[s idx]
Expand Down