Disable chat input for chats with blocked users

Signed-off-by: Audrius Molis <masta@dr.com>
This commit is contained in:
Audrius Molis 2022-03-10 17:01:53 +02:00
parent 66482863c1
commit 08da76c22a
No known key found for this signature in database
GPG Key ID: 5A441ABAA95169B8
1 changed files with 3 additions and 4 deletions

View File

@ -1033,9 +1033,8 @@
:<- [:chats/current-raw-chat]
:<- [:multiaccount/public-key]
:<- [:communities/current-community]
(fn [[{:keys [group-chat] :as current-chat}
my-public-key
community]]
:<- [:contacts/blocked-set]
(fn [[{:keys [group-chat chat-id] :as current-chat} my-public-key community blocked-users-set]]
(when current-chat
(cond-> current-chat
(chat.models/public-chat? current-chat)
@ -1051,7 +1050,7 @@
(assoc :show-input? true)
(not group-chat)
(assoc :show-input? true)))))
(assoc :show-input? (not (contains? blocked-users-set chat-id)))))))
(re-frame/reg-sub
:chats/current-chat-chat-view