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 (defn mark-chat-all-read
[db chat-id] [db chat-id]
(update-in db (when (get-in db [:chats chat-id])
[:chats chat-id] (update-in
assoc db
:unviewed-messages-count 0 [:chats chat-id]
:unviewed-mentions-count 0 assoc
:highlight false)) :unviewed-messages-count 0
:unviewed-mentions-count 0
:highlight false)))
(rf/defn handle-mark-all-read-successful (rf/defn handle-mark-all-read-successful
{:events [::mark-all-read-successful]} {:events [::mark-all-read-successful]}

View File

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