Skip to content

Commit

Permalink
[#19048] fix: address reviewers feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri committed Mar 8, 2024
1 parent 633e44c commit c70d42c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/status_im/common/universal_links.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
(handle-url url))))

(defn generate-profile-url
[{:keys [db]} [{:keys [public-key cb]}]]
[{:keys [db]} [{:keys [public-key on-success]}]]
(let [profile-public-key (get-in db [:profile/profile :public-key])
profile? (or (not public-key) (= public-key profile-public-key))
ens-name? (if profile?
Expand All @@ -186,7 +186,7 @@
:params [public-key]
:on-success (fn [url]
(rf/dispatch [:universal-links/save-profile-url public-key url])
(when (fn? cb) (cb)))
(when (fn? on-success) (on-success)))
:on-error #(log/error "failed to wakuext_shareUserURLWithData"
{:error %
:public-key public-key})}]})))
Expand All @@ -200,7 +200,7 @@
[:?
[:map
[:public-key {:optional true} :schema.common/public-key]
[:cb {:optional true} fn?]]]]]]
[:on-success {:optional true} fn?]]]]]]
[:map
[:json-rpc/call :schema.common/rpc-call]]])

Expand Down
4 changes: 2 additions & 2 deletions src/status_im/contexts/profile/contact/actions/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
(fn []
(rf/dispatch [:universal-links/generate-profile-url
{:public-key public-key
:cb (#(rf/dispatch [:open-modal
:share-contact]))}]))
:on-success #(rf/dispatch [:open-modal
:share-contact])}]))
[public-key])
has-nickname? (rn/use-memo (fn [] (not (string/blank? nickname))) [nickname])]
[quo/action-drawer
Expand Down
9 changes: 5 additions & 4 deletions src/status_im/contexts/profile/contact/share/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
abbreviated-url (rn/use-memo (fn []
(address/get-abbreviated-profile-url universal-profile-url))
[universal-profile-url])
profile-picture (rn/use-memo #(profile.utils/photo profile) [])
display-name (rn/use-memo #(profile.utils/displayed-name profile) [])
on-back-press (rn/use-callback #(rf/dispatch [:navigate-back]))
on-share-press (rn/use-callback #(list-selection/open-share {:message universal-profile-url}))
profile-picture (rn/use-memo #(profile.utils/photo profile) [profile])
display-name (rn/use-memo #(profile.utils/displayed-name profile) [profile])
on-back-press #(rf/dispatch [:navigate-back])
on-share-press (rn/use-callback #(list-selection/open-share {:message universal-profile-url})
[universal-profile-url])
on-copy-press (rn/use-callback (fn []
(rf/dispatch [:share/copy-text-and-show-toast
{:text-to-copy universal-profile-url
Expand Down

0 comments on commit c70d42c

Please sign in to comment.