Skip to content

Commit

Permalink
fix(add-contact): handle compress pubkey error from status-go
Browse files Browse the repository at this point in the history
  • Loading branch information
yqrashawn committed Nov 1, 2023
1 parent 5f893f4 commit 7f23ffe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/status_im2/contexts/add_new_contact/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,11 @@
(let [contact (get-in db [:contacts/new-identity])]
(when (= (:input contact) input)
(let [state (cond
(or (string/includes? (:message err) "fallback failed")
(string/includes? (:message err) "no such host"))
(and (string? err) (string/includes? err "invalid public key"))
{:state :invalid :msg :t/not-a-chatkey}
(and (string? (:message err))
(or (string/includes? (:message err) "fallback failed")
(string/includes? (:message err) "no such host")))
{:state :invalid :msg :t/lost-connection}
:else {:state :invalid})]
{:db (assoc db :contacts/new-identity (merge contact state))}))))
Expand Down

0 comments on commit 7f23ffe

Please sign in to comment.