From c2212af3ff69474331439e53987f1c2df11b91f7 Mon Sep 17 00:00:00 2001 From: andrey Date: Wed, 21 Apr 2021 10:15:10 +0200 Subject: [PATCH] [#12014] Skip 'Accept and join' view when navigating back from public chat joined from referral Signed-off-by: Andrea Maria Piana --- src/status_im/acquisition/chat.cljs | 2 +- src/status_im/ui/screens/chat/toolbar_content.cljs | 7 +++++-- src/status_im/ui/screens/referrals/public_chat.cljs | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/status_im/acquisition/chat.cljs b/src/status_im/acquisition/chat.cljs index 50db3c1727..e343d2cacf 100644 --- a/src/status_im/acquisition/chat.cljs +++ b/src/status_im/acquisition/chat.cljs @@ -38,7 +38,7 @@ (fx/defn join-public-chat [cofx chat-name] - (chat/start-public-chat cofx chat-name nil)) + (chat/start-public-chat cofx chat-name {:navigation-reset? true})) (fx/defn accept-pack {:events [::accept-pack]} diff --git a/src/status_im/ui/screens/chat/toolbar_content.cljs b/src/status_im/ui/screens/chat/toolbar_content.cljs index de17f6a8c3..26fc5a6ae7 100644 --- a/src/status_im/ui/screens/chat/toolbar_content.cljs +++ b/src/status_im/ui/screens/chat/toolbar_content.cljs @@ -31,9 +31,9 @@ (i18n/label :chat-is-a-contact) (i18n/label :chat-is-not-a-contact))]])) -(defn toolbar-content-view [] +(defn toolbar-content-view-inner [chat-info] (let [{:keys [group-chat invitation-admin color chat-id contacts chat-type chat-name public?]} - @(re-frame/subscribe [:chats/current-chat])] + chat-info] [react/view {:style st/toolbar-container} [react/view {:margin-right 10} [react/touchable-highlight {:on-press #(when-not group-chat (re-frame/dispatch [:chat.ui/show-profile chat-id]))} @@ -50,3 +50,6 @@ (when (and group-chat (not invitation-admin) (not= chat-type constants/community-chat-type)) [group-last-activity {:contacts contacts :public? public?}])]])) + +(defn toolbar-content-view [] + [toolbar-content-view-inner @(re-frame/subscribe [:chats/current-chat])]) diff --git a/src/status_im/ui/screens/referrals/public_chat.cljs b/src/status_im/ui/screens/referrals/public_chat.cljs index b6db5ec12e..7f0f1f4d5a 100644 --- a/src/status_im/ui/screens/referrals/public_chat.cljs +++ b/src/status_im/ui/screens/referrals/public_chat.cljs @@ -83,7 +83,7 @@ :group-chat true}] [:<> [topbar/topbar - {:content [toolbar-content/toolbar-content-view chat-info] + {:content [toolbar-content/toolbar-content-view-inner chat-info] :navigation {:on-press #(re-frame/dispatch [:navigate-to :home])}}] [rn/scroll-view {:style {:flex 1} :center-content true