[16524] Fix chevron icon showing when chat is muted (#16528)

This commit is contained in:
Ibrahem Khalil 2023-07-12 11:28:53 +03:00 committed by GitHub
parent bcb55a1ab3
commit 2e397f0065
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 12 deletions

View File

@ -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?]

View File

@ -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
[]