[#13068] No error "Profile not found" if entering invalid public key in New chat field

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
andrey 2022-02-03 13:03:12 +01:00
parent 3745a8e2fe
commit c1a338c2dd
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
1 changed files with 2 additions and 4 deletions

View File

@ -27,10 +27,8 @@
(fx/defn new-chat-set-new-identity (fx/defn new-chat-set-new-identity
{:events [:new-chat/set-new-identity]} {:events [:new-chat/set-new-identity]}
[{db :db} new-identity-raw new-ens-name id] [{db :db} new-identity-raw new-ens-name id]
(let [new-identity (utils/safe-trim new-identity-raw) (let [ens-error (and (= new-identity-raw "0x") (not (string/blank? new-ens-name)))]
ens-error (and (= new-identity-raw "0x") (not (string/blank? new-ens-name)))] (when (or (not id) (= id @resolve-last-id))
(when (and (or (not id) (= id @resolve-last-id))
(or ens-error (> (count new-identity) 4)))
(if ens-error (if ens-error
{:db (assoc-in db [:contacts/new-identity :state] :error)} {:db (assoc-in db [:contacts/new-identity :state] :error)}
(let [new-identity (utils/safe-trim new-identity-raw) (let [new-identity (utils/safe-trim new-identity-raw)