Code Improvements of 15048 (#15351)

This commit is contained in:
Ibrahem Khalil 2023-03-15 20:08:59 +02:00 committed by GitHub
parent b5781a7a83
commit f981021a1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -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) %)
[{: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
[_]