From 078976806a2674f891ac20311c2623b1fd930a1a Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Wed, 25 Oct 2023 16:38:01 +0530 Subject: [PATCH] Don't display "Add Unknown as contact to send a Message" if chat is not loaded (#17704) --- src/status_im2/contexts/chat/messages/view.cljs | 13 +++++++------ .../contexts/communities/overview/view.cljs | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/status_im2/contexts/chat/messages/view.cljs b/src/status_im2/contexts/chat/messages/view.cljs index c3dbf7df1c..cefec73c60 100644 --- a/src/status_im2/contexts/chat/messages/view.cljs +++ b/src/status_im2/contexts/chat/messages/view.cljs @@ -82,12 +82,13 @@ :online? online? :photo-path photo-path}] - (if able-to-send-message? - [:f> composer.view/composer - {:insets insets - :scroll-to-bottom-fn list.view/scroll-to-bottom - :show-floating-scroll-down-button? show-floating-scroll-down-button?}] - [contact-requests.bottom-drawer/view chat-id contact-request-state group-chat])])) + (when (seq chat) + (if able-to-send-message? + [:f> composer.view/composer + {:insets insets + :scroll-to-bottom-fn list.view/scroll-to-bottom + :show-floating-scroll-down-button? show-floating-scroll-down-button?}] + [contact-requests.bottom-drawer/view chat-id contact-request-state group-chat]))])) (defn chat [] diff --git a/src/status_im2/contexts/communities/overview/view.cljs b/src/status_im2/contexts/communities/overview/view.cljs index 1510f033e6..2c1e077f47 100644 --- a/src/status_im2/contexts/communities/overview/view.cljs +++ b/src/status_im2/contexts/communities/overview/view.cljs @@ -14,6 +14,7 @@ [status-im2.contexts.communities.actions.community-options.view :as options] [status-im2.contexts.communities.overview.style :as style] [status-im2.contexts.communities.overview.utils :as utils] + [utils.debounce :as debounce] [utils.i18n :as i18n] [utils.re-frame :as rf])) @@ -210,7 +211,7 @@ (when (and (not locked?) id) {:on-press (fn [] (rf/dispatch [:dismiss-keyboard]) - (rf/dispatch [:chat/navigate-to-chat (str community-id id)])) + (debounce/dispatch-and-chill [:chat/navigate-to-chat (str community-id id)] 1000)) :on-long-press #(rf/dispatch [:show-bottom-sheet {:content (fn []