From a94797710a98408144a86764fd78013b1d72e1c2 Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Mon, 8 Aug 2022 22:18:59 +0530 Subject: [PATCH] fix send button remains active in chats after sending reply containing a mention (#13774) --- src/status_im/ui/screens/chat/components/input.cljs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/status_im/ui/screens/chat/components/input.cljs b/src/status_im/ui/screens/chat/components/input.cljs index d7a7696f8f..468ae98d88 100644 --- a/src/status_im/ui/screens/chat/components/input.cljs +++ b/src/status_im/ui/screens/chat/components/input.cljs @@ -350,11 +350,12 @@ :active active-panel :set-active set-active-panel}])]) -(defn chat-toolbar [] - (let [actions-ref (quo.react/create-ref) - send-ref (quo.react/create-ref) - sticker-ref (quo.react/create-ref) - toolbar-options (re-frame/subscribe [:chats/chat-toolbar])] +(defn chat-toolbar [{:keys [chat-id]}] + (let [actions-ref (quo.react/create-ref) + send-ref (quo.react/create-ref) + sticker-ref (quo.react/create-ref) + toolbar-options (re-frame/subscribe [:chats/chat-toolbar]) + show-send (seq (get @input-texts chat-id))] (fn [{:keys [active-panel set-active-panel text-input-ref chat-id]}] (let [;we want to control components on native level, so instead of RN state we set native props via reference ;we don't react on input text in this view, @input-texts below is a regular atom @@ -363,7 +364,7 @@ :sticker-ref sticker-ref :text-input-ref text-input-ref} {:keys [send stickers image extensions audio sending-image]} @toolbar-options - show-send (or sending-image (seq (get @input-texts chat-id))) + show-send (or show-send sending-image) contact-request @(re-frame/subscribe [:chats/sending-contact-request])] [rn/view {:style (styles/toolbar) :on-layout on-chat-toolbar-layout}