Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ulisesmac committed Feb 2, 2024
1 parent c53e608 commit c85ef01
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/status_im/contexts/wallet/send/input_amount/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@
bottom (safe-area/get-bottom)
input-value (reagent/atom "")
input-error (reagent/atom false)
input-selection (reagent/atom {:start 0 :end 0})
input-selection (reagent/atom {:start 0 :end 0})
crypto-currency? (reagent/atom initial-crypto-currency?)
handle-swap (fn [{:keys [crypto? limit-fiat limit-crypto]}]
(let [num-value (parse-double @input-value)
current-limit (if crypto? limit-crypto limit-fiat)]
(reset! crypto-currency? crypto?)
(reset-input-error num-value current-limit input-error)))
handle-keyboard-press (fn [v loading-routes? current-limit-amount]
(let [current-value @input-value
new-value (make-new-input current-value v input-selection)
num-value (or (parse-double new-value) 0)]
(when (not loading-routes?)
(when-not loading-routes?
(let [current-value @input-value
new-value (make-new-input current-value v input-selection)
num-value (or (parse-double new-value) 0)]
(reset! input-value new-value)
(reset-input-error num-value current-limit-amount input-error)
(reagent/flush))))
Expand All @@ -131,13 +131,13 @@
(reset! input-value v)
(reset-input-error num-value current-limit-amount input-error)
(reagent/flush))))
selection-change (fn [selection]
;; `reagent/flush` is needed to properly propagate the
;; input cursor state. Since this is a controlled
;; component the cursor will become static if
;; `reagent/flush` is removed.
(reset! input-selection selection)
(reagent/flush))
selection-change (fn [selection]
;; `reagent/flush` is needed to properly propagate the
;; input cursor state. Since this is a controlled
;; component the cursor will become static if
;; `reagent/flush` is removed.
(reset! input-selection selection)
(reagent/flush))
on-navigate-back (fn []
(rf/dispatch [:wallet/clean-selected-token])
(rf/dispatch [:navigate-back-within-stack :wallet-send-input-amount]))
Expand Down Expand Up @@ -207,7 +207,6 @@
:show-keyboard? false
:value @input-value
:selection @input-selection
:on-swap handle-swap
:on-change-text #(handle-on-change % current-limit)
:on-selection-change selection-change
:on-swap #(handle-swap
Expand Down

0 comments on commit c85ef01

Please sign in to comment.