From bac5839dd0bd9f5e3cbfcd5336c07037d407bc1a Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Tue, 16 Oct 2018 10:17:09 +0300 Subject: [PATCH] [#6156] fix Share link button in user's profile does not contain profile universal link --- src/status_im/ui/screens/profile/events.cljs | 6 ++++-- src/status_im/ui/screens/profile/user/views.cljs | 5 +++-- src/status_im/utils/universal_links/core.cljs | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/status_im/ui/screens/profile/events.cljs b/src/status_im/ui/screens/profile/events.cljs index ee2f8b7b4e..f643a36dd4 100644 --- a/src/status_im/ui/screens/profile/events.cljs +++ b/src/status_im/ui/screens/profile/events.cljs @@ -6,7 +6,8 @@ [status-im.ui.components.list-selection :as list-selection] [status-im.ui.screens.profile.models :as profile.models] [status-im.utils.handlers :as handlers] - [status-im.utils.identicon :as identicon])) + [status-im.utils.identicon :as identicon] + [status-im.utils.universal-links.core :as universal-links])) (re-frame/reg-fx :open-image-picker @@ -89,7 +90,8 @@ (re-frame/reg-fx :profile/share-profile-link (fn [contact-code] - (list-selection/open-share {:message contact-code}))) + (let [link (universal-links/generate-link :user :external contact-code)] + (list-selection/open-share {:message link})))) (handlers/register-handler-fx :profile/share-profile-link diff --git a/src/status_im/ui/screens/profile/user/views.cljs b/src/status_im/ui/screens/profile/user/views.cljs index bf6cb77ce9..e4848fa432 100644 --- a/src/status_im/ui/screens/profile/user/views.cljs +++ b/src/status_im/ui/screens/profile/user/views.cljs @@ -23,7 +23,8 @@ [status-im.ui.components.icons.vector-icons :as icons] [status-im.ui.components.common.common :as components.common] [status-im.utils.identicon :as identicon] - [clojure.string :as string])) + [clojure.string :as string] + [status-im.utils.universal-links.core :as universal-links])) (defn my-profile-toolbar [] [toolbar/toolbar {} @@ -86,7 +87,7 @@ [qr-code-viewer/qr-code-viewer {:style styles/qr-code :footer-button qr-code-share-button - :value value + :value (universal-links/generate-link :user :external value) :hint (i18n/label :t/qr-code-public-key-hint) :legend (str value)}]])) diff --git a/src/status_im/utils/universal_links/core.cljs b/src/status_im/utils/universal_links/core.cljs index b1ede53ea6..f234325ad6 100644 --- a/src/status_im/utils/universal_links/core.cljs +++ b/src/status_im/utils/universal_links/core.cljs @@ -26,6 +26,7 @@ :internal "status-im:/"}) (def links {:public-chat "%s/chat/public/%s" + :user "%s/user/%s" :browse "%s/browse/%s"}) (defn generate-link [link-type domain-type param]