From 1ca949ba88139ce3abbc05d43baa7684d78b8cc9 Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Mon, 26 Jun 2023 13:22:31 +0530 Subject: [PATCH] review changes --- src/status_im2/subs/shell.cljs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/status_im2/subs/shell.cljs b/src/status_im2/subs/shell.cljs index b157dc1ae9c7..809141f28953 100644 --- a/src/status_im2/subs/shell.cljs +++ b/src/status_im2/subs/shell.cljs @@ -19,7 +19,7 @@ (first images)))}))) (defn get-card-content - [chat communities group-chat primary-name] + [{:keys [chat communities group-chat? primary-name]}] (let [{:keys [content-type content deleted? outgoing deleted-for-me?] :as last-message} (:last-message chat)] (merge @@ -30,7 +30,7 @@ :data {:text (if (or deleted-for-me? outgoing) (i18n/label :t/you-deleted-a-message) - (if group-chat + (if (and group-chat? primary-name) (i18n/label :t/user-deleted-a-message {:user primary-name}) (i18n/label :t/this-message-was-deleted)))}} @@ -65,9 +65,7 @@ (let [community (get communities (:community-id last-message))] {:content-type constants/content-type-community :data {:avatar (community-avatar community) - :community-name (:name community)}}) - - :else nil)) + :community-name (:name community)}}))) {:new-notifications? (pos? (:unviewed-messages-count chat)) :notification-indicator (if (pos? (:unviewed-mentions-count chat)) :counter @@ -83,7 +81,9 @@ :profile-picture (when profile-picture (str profile-picture "&addRing=0"))} :customization-color (or (:customization-color contact) :primary) - :content (get-card-content chat communities false nil) + :content (get-card-content + {:chat chat + :communities communities}) :id id})) (defn private-group-chat-card @@ -91,7 +91,11 @@ {:title (:chat-name chat) :avatar-params {} :customization-color (or (:customization-color chat) :primary) - :content (get-card-content chat communities true primary-name) + :content (get-card-content + {:chat chat + :communities communities + :group-chat? true + :primary-name primary-name}) :id id}) (defn community-card