fix: inability to input data while routes are loading (#20298)

fix: inability to input data while routes are loading (#20298)
This commit is contained in:
Omar Basem 2024-06-11 08:05:47 +04:00 committed by GitHub
parent 3634edab42
commit 0d2869bfe0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 10 deletions

View File

@ -376,18 +376,17 @@
max-decimals (if crypto-currency? crypto-decimals 2)
regex-pattern (str "^\\d*\\.?\\d{0," max-decimals "}$")
regex (re-pattern regex-pattern)]
(when (and (not loading-routes?)
(re-matches regex new-text))
(when (re-matches regex new-text)
(debounce/clear-all)
(set-just-toggled-mode? false)
(set-input-state #(controlled-input/add-character % c)))))
:on-delete (fn []
(when-not loading-routes?
(debounce/clear-all)
(set-just-toggled-mode? false)
(set-input-state controlled-input/delete-last)))
(debounce/clear-all)
(set-just-toggled-mode? false)
(set-input-state controlled-input/delete-last)
(rf/dispatch [:wallet/clean-suggested-routes]))
:on-long-press-delete (fn []
(when-not loading-routes?
(debounce/clear-all)
(set-just-toggled-mode? false)
(set-input-state controlled-input/delete-all)))}]]))
(debounce/clear-all)
(set-just-toggled-mode? false)
(set-input-state controlled-input/delete-all)
(rf/dispatch [:wallet/clean-suggested-routes]))}]]))