[#15241] Proper system message on being not a member of a group

This commit is contained in:
Roman Volosovskyi 2023-03-06 17:53:04 +01:00
parent 998b40ec4f
commit c6e63ff5a5
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
3 changed files with 7 additions and 3 deletions

View File

@ -7,7 +7,7 @@
[status-im2.constants :as constants]))
(defn view
[contact-id contact-request-state]
[contact-id contact-request-state group-chat]
(let [names (rf/sub [:contacts/contact-two-names-by-identity contact-id])]
[permission-context/view
[quo/button
@ -15,6 +15,9 @@
:on-press #(rf/dispatch [:chat.ui/show-profile contact-id])
:before :i/communities}
(cond
group-chat
(i18n/label :t/group-chat-not-member)
(or (not contact-request-state)
(= contact-request-state
constants/contact-request-state-none)

View File

@ -67,7 +67,7 @@
(defn chat-render
[]
(let [;;NOTE: we want to react only on these fields, do not use full chat map here
{:keys [chat-id contact-request-state show-input?] :as chat}
{:keys [chat-id contact-request-state group-chat show-input?] :as chat}
(rf/sub [:chats/current-chat-chat-view])]
[safe-area/consumer
(fn [insets]
@ -78,7 +78,7 @@
[pin.banner/banner chat-id]
[messages.list/messages-list {:chat chat :show-input? show-input?}]
(if-not show-input?
[contact-requests.bottom-drawer/view chat-id contact-request-state]
[contact-requests.bottom-drawer/view chat-id contact-request-state group-chat]
[composer/composer chat-id insets])])]))
(defn chat

View File

@ -642,6 +642,7 @@
"group-chat-member-removed": "**{{member}}** left the group",
"group-chat-members-count": "{{selected}}/{{max}} members",
"group-chat-name-changed": "**{{member}}** changed the group's name to **{{name}}**",
"group-chat-not-member": "You are not a member of this group",
"group-chat-no-contacts": "You don't have any contacts yet.\nInvite your friends to start chatting",
"leave-chat": "Leave chat",
"leave-confirmation": "Leave {{chat-name}}",