Don't display "Add Unknown as contact to send a Message" if chat is not loaded

This commit is contained in:
Parvesh Monu 2023-09-01 18:04:54 +05:30 committed by GitHub
parent 72455877bd
commit 77fc7a92d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 11 deletions

View File

@ -59,12 +59,14 @@
(defn mark-chat-all-read
[db chat-id]
(update-in db
[:chats chat-id]
assoc
:unviewed-messages-count 0
:unviewed-mentions-count 0
:highlight false))
(when (get-in db [:chats chat-id])
(update-in
db
[:chats chat-id]
assoc
:unviewed-messages-count 0
:unviewed-mentions-count 0
:highlight false)))
(rf/defn handle-mark-all-read-successful
{:events [::mark-all-read-successful]}

View File

@ -18,8 +18,9 @@
:chat current-chat
:header-comp (fn [{:keys [scroll-y]}]
[messages.navigation/navigation-view {:scroll-y scroll-y}])
:footer-comp (fn [{:keys [insets]}]
(if-not able-to-send-message?
[contact-requests.bottom-drawer/view chat-id contact-request-state
group-chat]
[:f> composer/composer insets]))}]))
:footer-comp (when (some? able-to-send-message?)
(fn [{:keys [insets]}]
(if-not able-to-send-message?
[contact-requests.bottom-drawer/view chat-id contact-request-state
group-chat]
[:f> composer/composer insets])))}]))