diff --git a/src/status_im/bootnodes/core.cljs b/src/status_im/bootnodes/core.cljs index 687aea9752..fdbee6abd2 100644 --- a/src/status_im/bootnodes/core.cljs +++ b/src/status_im/bootnodes/core.cljs @@ -3,6 +3,7 @@ [re-frame.core :as re-frame] [status-im.accounts.update.core :as accounts.update] [status-im.i18n :as i18n] + [status-im.ui.screens.navigation :as navigation] [status-im.utils.fx :as fx])) @@ -92,7 +93,7 @@ (fx/defn set-bootnodes-from-qr [cofx url] - (assoc (set-input :url url cofx) + (assoc (set-input cofx :url (string/trim url)) :dispatch [:navigate-back])) (fx/defn show-delete-bootnode-confirmation diff --git a/test/cljs/status_im/test/models/bootnode.cljs b/test/cljs/status_im/test/models/bootnode.cljs index f9013118af..7e5055e65b 100644 --- a/test/cljs/status_im/test/models/bootnode.cljs +++ b/test/cljs/status_im/test/models/bootnode.cljs @@ -61,6 +61,13 @@ :error true}}}} (model/set-input {:db {}} :url "broken")))))) +(deftest set-bootnode-from-qr + (testing "correct name" + (is (= {:dispatch [:navigate-back] + :db {:bootnodes/manage {:url {:value valid-bootnode-address + :error false}}}} + (model/set-bootnodes-from-qr {:db {}} (str valid-bootnode-address " ")))))) + (deftest edit-bootnode (let [db {:network "mainnet_rpc" :account/account