diff --git a/src/status_im/contexts/wallet/send/input_amount/view.cljs b/src/status_im/contexts/wallet/send/input_amount/view.cljs index 900c2ef073ee..5aa9fe2335ae 100644 --- a/src/status_im/contexts/wallet/send/input_amount/view.cljs +++ b/src/status_im/contexts/wallet/send/input_amount/view.cljs @@ -102,7 +102,7 @@ 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) @@ -110,10 +110,10 @@ (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)))) @@ -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])) @@ -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