fix(group-chat): Missing group chat name when clearing history (#21684)

Fix missing group name when user chooses drawer option to clear chat history
from within the group chat screen.

Fixes https://github.com/status-im/status-mobile/issues/21639
This commit is contained in:
Icaro Motta 2024-12-02 22:01:53 -03:00 committed by GitHub
parent 7537c6b033
commit 3a444f40f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 24 deletions

View File

@ -159,10 +159,10 @@
:add-divider? needs-divider?})) :add-divider? needs-divider?}))
(defn clear-history-entry (defn clear-history-entry
[chat-id needs-divider?] [chat needs-divider?]
(entry {:icon :i/delete (entry {:icon :i/delete
:label (i18n/label :t/clear-history) :label (i18n/label :t/clear-history)
:on-press #(clear-history-action chat-id) :on-press #(clear-history-action chat)
:danger? true :danger? true
:sub-label nil :sub-label nil
:accessibility-label :clear-history :accessibility-label :clear-history

View File

@ -171,29 +171,26 @@
chat.events/public-chat? :public-chat chat.events/public-chat? :public-chat
:chat))) :chat)))
(re-frame/reg-sub (re-frame/reg-sub :chats/current-chat-chat-view
:chats/current-chat-chat-view
:<- [:chats/current-chat] :<- [:chats/current-chat]
(fn [current-chat] (fn [chat]
(assoc {:able-to-send-message? (:able-to-send-message? chat)
(select-keys current-chat :admins (:admins chat)
[:chat-id :chat-id (:chat-id chat)
:able-to-send-message? :chat-name (:chat-name chat)
:group-chat :chat-type (:chat-type chat)
:admins :color (:color chat)
:invitation-admin :community-id (:community-id chat)
:public? :contact-request-state (:contact-request-state chat)
:chat-type :description (:description chat)
:color :emoji (:emoji chat)
:contact-request-state :empty-chat? (not (:last-message chat))
:chat-name :group-chat (:group-chat chat)
:synced-to :invitation-admin (:invitation-admin chat)
:synced-from :name (:name chat)
:community-id :public? (:public? chat)
:emoji :synced-from (:synced-from chat)
:description]) :synced-to (:synced-to chat)}))
:empty-chat?
(not (:last-message current-chat)))))
(re-frame/reg-sub (re-frame/reg-sub
:chats/current-chat-exist? :chats/current-chat-exist?