mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-27 00:49:39 +00:00
fix deep links to user profiles don't do anything on tap (#15089)
This commit is contained in:
parent
ab750c1829
commit
5cea66647e
@ -8,6 +8,8 @@
|
||||
[status-im.ethereum.core :as ethereum]
|
||||
[status-im.ethereum.eip681 :as eip681]
|
||||
[status-im.ethereum.ens :as ens]
|
||||
[status-im.utils.types :as types]
|
||||
[status-im.native-module.core :as status]
|
||||
[status-im.ethereum.stateofus :as stateofus]
|
||||
[status-im2.utils.validators :as validators]
|
||||
[status-im.utils.http :as http]
|
||||
@ -71,15 +73,27 @@
|
||||
|
||||
(defn match-contact-async
|
||||
[chain {:keys [user-id ens-name]} callback]
|
||||
(let [valid-key (and (validators/valid-public-key? user-id)
|
||||
(not= user-id ens/default-key))]
|
||||
(let [valid-public-key? (and (validators/valid-public-key? user-id)
|
||||
(not= user-id ens/default-key))
|
||||
valid-compressed-key? (validators/valid-compressed-key? user-id)]
|
||||
(cond
|
||||
valid-key
|
||||
valid-public-key?
|
||||
(callback {:type :contact
|
||||
:public-key user-id
|
||||
:ens-name ens-name})
|
||||
|
||||
(and (not valid-key)
|
||||
valid-compressed-key?
|
||||
(status/compressed-key->public-key
|
||||
user-id
|
||||
(fn [response]
|
||||
(let [{:keys [error]} (types/json->clj response)]
|
||||
(when-not error
|
||||
(match-contact-async
|
||||
chain
|
||||
{:user-id (str "0x" (subs response 5)) :ens-name ens-name}
|
||||
callback)))))
|
||||
|
||||
(and (not valid-public-key?)
|
||||
(string? user-id)
|
||||
(not (string/blank? user-id))
|
||||
(not= user-id "0x"))
|
||||
|
@ -113,11 +113,7 @@
|
||||
:pop-to-root-tab-fx :profile-stack}
|
||||
|
||||
public-key
|
||||
(navigation/navigate-to-cofx (-> cofx
|
||||
(assoc-in [:db :contacts/identity] public-key)
|
||||
(assoc-in [:db :contacts/ens-name] ens-name))
|
||||
:profile
|
||||
{})))
|
||||
{:dispatch [:chat.ui/show-profile public-key ens-name]}))
|
||||
|
||||
(rf/defn handle-eip681
|
||||
[cofx data]
|
||||
|
Loading…
x
Reference in New Issue
Block a user