From 2e397f0065c7d54370fcaa5663aa0506d2eaff9e Mon Sep 17 00:00:00 2001 From: Ibrahem Khalil Date: Wed, 12 Jul 2023 11:28:53 +0300 Subject: [PATCH] [16524] Fix chevron icon showing when chat is muted (#16528) --- src/status_im2/common/home/actions/view.cljs | 2 +- .../communities/actions/chat/view.cljs | 24 ++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/status_im2/common/home/actions/view.cljs b/src/status_im2/common/home/actions/view.cljs index 866de58fc5..a7c6a93b65 100644 --- a/src/status_im2/common/home/actions/view.cljs +++ b/src/status_im2/common/home/actions/view.cljs @@ -139,7 +139,7 @@ #(mute-chat-action chat-id chat-type)) :danger? false :accessibility-label :mute-chat - :chevron? true}))) + :chevron? (not muted?)}))) (defn mark-as-read-entry [chat-id needs-divider?] diff --git a/src/status_im2/contexts/communities/actions/chat/view.cljs b/src/status_im2/contexts/communities/actions/chat/view.cljs index c23057aab4..1f661a29e6 100644 --- a/src/status_im2/contexts/communities/actions/chat/view.cljs +++ b/src/status_im2/contexts/communities/actions/chat/view.cljs @@ -47,17 +47,19 @@ (defn- action-toggle-muted [id muted? muted-till chat-type] (let [muted (and muted? (some? muted-till))] - {:icon :i/muted - :right-icon :i/chevron-right - :accessibility-label :chat-toggle-muted - :sub-label (when muted - (str (i18n/label :t/muted-until) " " (datetime/format-mute-till muted-till))) - :on-press (if muted? - #(unmute-channel-action id) - #(mute-channel-action id chat-type)) - :label (i18n/label (if muted - :t/unmute-channel - :t/mute-channel))})) + (cond-> {:icon :i/muted + :accessibility-label :chat-toggle-muted + :sub-label (when muted + (str (i18n/label :t/muted-until) + " " + (datetime/format-mute-till muted-till))) + :on-press (if muted? + #(unmute-channel-action id) + #(mute-channel-action id chat-type)) + :label (i18n/label (if muted + :t/unmute-channel + :t/mute-channel))} + (not muted?) (assoc :right-icon :i/chevron-right)))) (defn- action-notification-settings []