[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:
parent
acc574cad2
commit
5467deec9a
|
@ -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))
|
||||
|
|
|
@ -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)))
|
||||
|
|
|
@ -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])}]]]])))
|
||||
|
|
Loading…
Reference in New Issue