From 71946823781f7d502eb53d30e6fa3396cc8d6f42 Mon Sep 17 00:00:00 2001 From: Brian Sztamfater Date: Mon, 11 Mar 2024 13:20:26 -0300 Subject: [PATCH] fix: unresponsive add watched address screen when entering a multi-chain address --- .../contexts/wallet/add_address_to_watch/view.cljs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/status_im/contexts/wallet/add_address_to_watch/view.cljs b/src/status_im/contexts/wallet/add_address_to_watch/view.cljs index e3187189fe76..cce40d2d64c2 100644 --- a/src/status_im/contexts/wallet/add_address_to_watch/view.cljs +++ b/src/status_im/contexts/wallet/add_address_to_watch/view.cljs @@ -6,6 +6,7 @@ [react-native.core :as rn] [reagent.core :as reagent] [status-im.common.floating-button-page.view :as floating-button-page] + [status-im.constants :as constants] [status-im.contexts.wallet.add-address-to-watch.style :as style] [status-im.contexts.wallet.common.validation :as validation] [status-im.subs.wallet.add-account.address-to-watch] @@ -22,6 +23,10 @@ (or (validation/eth-address? user-input) (validation/ens-name? user-input))) (i18n/label :t/invalid-address))) +(defn- extract-address + [scanned-text] + (re-find constants/regx-address-contains scanned-text)) + (defn- address-input [{:keys [input-value validation-msg validate clear-input]}] (let [scanned-address (rf/sub [:wallet/scanned-address]) @@ -138,7 +143,8 @@ :on-press (fn [] (rf/dispatch [:navigate-to :screen/wallet.confirm-address-to-watch - {:address validated-address}]) + {:address (extract-address + validated-address)}]) (clear-input)) :container-style {:z-index 2}} (i18n/label :t/continue)]}