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