From 5467deec9ad3dd097fa00f78305d659a004e78fc Mon Sep 17 00:00:00 2001 From: Eric Dvorsak Date: Tue, 18 Sep 2018 10:19:13 +0200 Subject: [PATCH] [fix 5814] fix add custom bootnode the validation regexp is expecting a password, there is no password for bootnodes Signed-off-by: yenda --- src/status_im/bootnodes/core.cljs | 2 +- src/status_im/events.cljs | 4 ++-- .../ui/screens/bootnodes_settings/edit_bootnode/views.cljs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/status_im/bootnodes/core.cljs b/src/status_im/bootnodes/core.cljs index d8c54088d6..bf3f690f8b 100644 --- a/src/status_im/bootnodes/core.cljs +++ b/src/status_im/bootnodes/core.cljs @@ -6,7 +6,7 @@ [status-im.ui.screens.navigation :as navigation] [status-im.utils.handlers-macro :as handlers-macro])) -(def address-regex #"enode://[a-zA-Z0-9]+:?(.*)\@\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b:(\d{1,5})") +(def address-regex #"enode://[a-zA-Z0-9]+\@\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b:(\d{1,5})") (defn valid-address? [address] (re-matches address-regex address)) diff --git a/src/status_im/events.cljs b/src/status_im/events.cljs index b31a320591..adb7ab4056 100644 --- a/src/status_im/events.cljs +++ b/src/status_im/events.cljs @@ -352,7 +352,7 @@ (bootnodes/edit bootnode-id cofx))) (handlers/register-handler-fx - :bootnodes/qr-code-scanned + :bootnodes.callback/qr-code-scanned (fn [cofx [_ _ url]] (bootnodes/set-bootnodes-from-qr url cofx))) @@ -362,7 +362,7 @@ (bootnodes/set-input input-key value cofx))) (handlers/register-handler-fx - :bootnodes.callback/save-new-bootnode + :bootnodes.ui/save-pressed [(re-frame/inject-cofx :random-id)] (fn [cofx _] (bootnodes/upsert cofx))) diff --git a/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs b/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs index 8b9d890e6e..43b5d6c505 100644 --- a/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs +++ b/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs @@ -49,7 +49,7 @@ :style styles/input :container styles/input-container :default-value name - :on-change-text #(re-frame/dispatch [:bootnode.ui/input-changed :name %]) + :on-change-text #(re-frame/dispatch [:bootnodes.ui/input-changed :name %]) :auto-focus true}] [text-input/text-input-with-label {:label (i18n/label :t/bootnode-address) @@ -67,4 +67,4 @@ {:forward? true :label (i18n/label :t/save) :disabled? (not is-valid?) - :on-press #(re-frame/dispatch [:bootnodes.ui/new-button-pressed])}]]]]))) + :on-press #(re-frame/dispatch [:bootnodes.ui/save-pressed])}]]]])))