From 68ae19ac5870d5f21478e351c6776331938b621d Mon Sep 17 00:00:00 2001 From: yqrashawn Date: Mon, 30 Oct 2023 22:54:09 +0800 Subject: [PATCH] fix(add-contact): handle compress pubkey error from status-go --- src/status_im2/contexts/add_new_contact/events.cljs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/status_im2/contexts/add_new_contact/events.cljs b/src/status_im2/contexts/add_new_contact/events.cljs index c54ed08a027f..6bc2b0e7e477 100644 --- a/src/status_im2/contexts/add_new_contact/events.cljs +++ b/src/status_im2/contexts/add_new_contact/events.cljs @@ -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))}))))