fix nickname not setted on adding contact (#13341)
* fix nickname not setted on adding contact * QA changes
This commit is contained in:
parent
81a8ed95a7
commit
b1606704f7
|
@ -68,7 +68,7 @@
|
|||
|
||||
(fx/defn qr-code-handled
|
||||
{:events [::qr-code-handled]}
|
||||
[{:keys [db] :as cofx} {:keys [type public-key chat-id data ens-name]} {:keys [new-contact?] :as opts}]
|
||||
[{:keys [db] :as cofx} {:keys [type public-key chat-id data ens-name]} {:keys [new-contact? nickname] :as opts}]
|
||||
(let [public-key? (and (string? data)
|
||||
(string/starts-with? data "0x"))
|
||||
chat-key (cond
|
||||
|
@ -80,7 +80,7 @@
|
|||
(if-not validation-result
|
||||
(if new-contact?
|
||||
(fx/merge cofx
|
||||
(contact/add-contact chat-key nil ens-name)
|
||||
(contact/add-contact chat-key nickname ens-name)
|
||||
(navigation/navigate-to-cofx :contacts-list {}))
|
||||
(chat/start-chat cofx chat-key ens-name))
|
||||
{:utils/show-popup {:title (i18n/label :t/unable-to-read-this-code)
|
||||
|
|
|
@ -254,8 +254,9 @@
|
|||
:auto-correct false}])
|
||||
|
||||
(defn new-contact []
|
||||
(let [entered-nickname (reagent/atom "")]
|
||||
(fn []
|
||||
(let [{:keys [state ens-name public-key error]} @(re-frame/subscribe [:contacts/new-identity])
|
||||
entered-nickname (reagent/atom "")
|
||||
blocked? (and
|
||||
(utils.db/valid-public-key? (or public-key ""))
|
||||
@(re-frame/subscribe [:contacts/contact-blocked? public-key]))]
|
||||
|
@ -269,7 +270,8 @@
|
|||
:on-press #(re-frame/dispatch [::qr-scanner/scan-code
|
||||
{:title (i18n/label :t/new-contact)
|
||||
:handler :contact/qr-code-scanned
|
||||
:new-contact? true}])}]}]
|
||||
:new-contact? true
|
||||
:nickname @entered-nickname}])}]}]
|
||||
[react/view {:flex-direction :row
|
||||
:padding 16}
|
||||
[react/view {:flex 1
|
||||
|
@ -304,8 +306,7 @@
|
|||
[react/text {:style {:margin-horizontal 16 :color colors/gray}}
|
||||
(i18n/label :t/nickname-description)]
|
||||
[react/view {:padding 16}
|
||||
|
||||
[nickname-input entered-nickname]
|
||||
[react/text {:style {:align-self :flex-end :margin-top 16
|
||||
:color colors/gray}}
|
||||
(str (count @entered-nickname) " / 32")]]]))
|
||||
(str (count @entered-nickname) " / 32")]]]))))
|
||||
|
|
Loading…
Reference in New Issue