[#12334] Redirect to home instead of community page when come back from community channel
Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
parent
e5477cd449
commit
d6d4b28e1e
|
@ -211,14 +211,16 @@
|
|||
(fx/defn navigate-to-chat
|
||||
"Takes coeffects map and chat-id, returns effects necessary for navigation and preloading data"
|
||||
{:events [:chat.ui/navigate-to-chat]}
|
||||
[{db :db :as cofx} chat-id]
|
||||
[{db :db :as cofx} chat-id dont-reset?]
|
||||
(fx/merge cofx
|
||||
(close-chat (:current-chat-id db))
|
||||
(fn [{:keys [db]}]
|
||||
{:db (assoc db :current-chat-id chat-id :ignore-close-chat true)})
|
||||
(preload-chat-data chat-id)
|
||||
(navigation/change-tab :chat)
|
||||
(navigation/pop-to-root-tab :chat-stack)
|
||||
#(when-not dont-reset?
|
||||
(navigation/change-tab % :chat))
|
||||
#(when-not dont-reset?
|
||||
(navigation/pop-to-root-tab % :chat-stack))
|
||||
(navigation/navigate-to-cofx :chat nil)))
|
||||
|
||||
(fx/defn handle-clear-history-response
|
||||
|
@ -279,7 +281,7 @@
|
|||
(if (or (new-public-chat.db/valid-topic? topic) profile-public-key)
|
||||
(if (active-chat? cofx topic)
|
||||
(when-not dont-navigate?
|
||||
(navigate-to-chat cofx topic))
|
||||
(navigate-to-chat cofx topic false))
|
||||
(create-public-chat-go
|
||||
cofx
|
||||
topic
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
(fx/defn create-from-link
|
||||
[cofx {:keys [chat-id invitation-admin chat-name]}]
|
||||
(if (get-in cofx [:db :chats chat-id :is-active])
|
||||
(models.chat/navigate-to-chat cofx chat-id)
|
||||
(models.chat/navigate-to-chat cofx chat-id false)
|
||||
{::json-rpc/call [{:method (json-rpc/call-ext-method "createGroupChatFromInvitation")
|
||||
:params [chat-name chat-id invitation-admin]
|
||||
:js-response true
|
||||
|
|
|
@ -145,9 +145,8 @@
|
|||
;; unread indicator
|
||||
(assoc home-item :public? true)
|
||||
{:on-press (fn []
|
||||
(re-frame/dispatch [:pop-to-root-tab :chat-stack])
|
||||
(re-frame/dispatch [:dismiss-keyboard])
|
||||
(re-frame/dispatch [:chat.ui/navigate-to-chat chat-id])
|
||||
(re-frame/dispatch [:chat.ui/navigate-to-chat chat-id true])
|
||||
(re-frame/dispatch [:search/home-filter-changed nil])
|
||||
(re-frame/dispatch [:accept-all-activity-center-notifications-from-chat chat-id]))
|
||||
:on-long-press #(re-frame/dispatch [:bottom-sheet/show-sheet
|
||||
|
|
Loading…
Reference in New Issue