From f981021a1f3cb44384020391bce16d828d34fa0d Mon Sep 17 00:00:00 2001 From: Ibrahem Khalil Date: Wed, 15 Mar 2023 20:08:59 +0200 Subject: [PATCH] Code Improvements of 15048 (#15351) --- src/status_im/communities/core.cljs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/status_im/communities/core.cljs b/src/status_im/communities/core.cljs index 5233fc3064..048f15bef0 100644 --- a/src/status_im/communities/core.cljs +++ b/src/status_im/communities/core.cljs @@ -15,7 +15,8 @@ [status-im2.navigation.events :as navigation] [taoensso.timbre :as log] [utils.i18n :as i18n] - [utils.re-frame :as rf])) + [utils.re-frame :as rf] + [status-im2.contexts.chat.events :as chat.events])) (def crop-size 1000) @@ -270,13 +271,12 @@ (rf/defn status-tag-pressed {:events [:communities/status-tag-pressed]} - [{:keys [db]} community-id literal] - (let [current-chat-id (:current-chat-id db) - {:keys [id]} (some #(when (= (:name %) literal) %) - (vals (get-in db [:communities community-id :chats])))] + [{:keys [db] :as cofx} community-id literal] + (let [{:keys [id]} (some #(when (= (:name %) literal) %) + (vals (get-in db [:communities community-id :chats])))] (when (and id - (not= current-chat-id (str community-id id))) - {:dispatch [:chat/navigate-to-chat (str community-id id)]}))) + (not= (:current-chat-id db) (str community-id id))) + (chat.events/navigate-to-chat cofx (str community-id id) nil)))) (rf/defn fetch [_]