[fix 5814] fix add custom bootnode

the validation regexp is expecting a password, there is no password
for bootnodes

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
Eric Dvorsak 2018-09-18 10:19:13 +02:00 committed by yenda
parent acc574cad2
commit 5467deec9a
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
3 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,7 @@
[status-im.ui.screens.navigation :as navigation] [status-im.ui.screens.navigation :as navigation]
[status-im.utils.handlers-macro :as handlers-macro])) [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] (defn valid-address? [address]
(re-matches address-regex address)) (re-matches address-regex address))

View File

@ -352,7 +352,7 @@
(bootnodes/edit bootnode-id cofx))) (bootnodes/edit bootnode-id cofx)))
(handlers/register-handler-fx (handlers/register-handler-fx
:bootnodes/qr-code-scanned :bootnodes.callback/qr-code-scanned
(fn [cofx [_ _ url]] (fn [cofx [_ _ url]]
(bootnodes/set-bootnodes-from-qr url cofx))) (bootnodes/set-bootnodes-from-qr url cofx)))
@ -362,7 +362,7 @@
(bootnodes/set-input input-key value cofx))) (bootnodes/set-input input-key value cofx)))
(handlers/register-handler-fx (handlers/register-handler-fx
:bootnodes.callback/save-new-bootnode :bootnodes.ui/save-pressed
[(re-frame/inject-cofx :random-id)] [(re-frame/inject-cofx :random-id)]
(fn [cofx _] (fn [cofx _]
(bootnodes/upsert cofx))) (bootnodes/upsert cofx)))

View File

@ -49,7 +49,7 @@
:style styles/input :style styles/input
:container styles/input-container :container styles/input-container
:default-value name :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}] :auto-focus true}]
[text-input/text-input-with-label [text-input/text-input-with-label
{:label (i18n/label :t/bootnode-address) {:label (i18n/label :t/bootnode-address)
@ -67,4 +67,4 @@
{:forward? true {:forward? true
:label (i18n/label :t/save) :label (i18n/label :t/save)
:disabled? (not is-valid?) :disabled? (not is-valid?)
:on-press #(re-frame/dispatch [:bootnodes.ui/new-button-pressed])}]]]]))) :on-press #(re-frame/dispatch [:bootnodes.ui/save-pressed])}]]]])))