From e1acf01c348c4c642000261ed8571c06a715dbca Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Wed, 5 Jun 2024 16:36:51 +0530 Subject: [PATCH] fix wrong composer opacity with minimised keyboard when editing message --- .../contexts/chat/messenger/composer/effects.cljs | 9 ++++----- .../contexts/chat/messenger/composer/utils.cljs | 8 ++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/status_im/contexts/chat/messenger/composer/effects.cljs b/src/status_im/contexts/chat/messenger/composer/effects.cljs index e7dc63cdb52..d7627cf1c15 100644 --- a/src/status_im/contexts/chat/messenger/composer/effects.cljs +++ b/src/status_im/contexts/chat/messenger/composer/effects.cljs @@ -76,11 +76,10 @@ (reset! gesture-enabled? false))) (defn empty-effect - [{:keys [empty-input?]} - {:keys [input-text images link-previews? reply audio]}] + [{:keys [empty-input?]} subscriptions] (reanimated/set-shared-value empty-input? - (utils/empty-input? input-text images link-previews? reply audio))) + (utils/empty-input? subscriptions))) (defn component-will-unmount [{:keys [keyboard-show-listener keyboard-hide-listener keyboard-frame-listener]}] @@ -90,7 +89,7 @@ (defn initialize [props state animations {:keys [max-height] :as dimensions} - {:keys [chat-input audio input-text images link-previews? reply] :as subscriptions}] + {:keys [chat-input audio input-text images link-previews? reply edit] :as subscriptions}] (rn/use-effect (fn [] (maximized-effect state animations dimensions chat-input) @@ -105,7 +104,7 @@ (rn/use-effect (fn [] (empty-effect animations subscriptions)) - [input-text images link-previews? reply]) + [input-text images link-previews? reply edit audio]) (rn/use-mount #(reenter-screen-effect state dimensions subscriptions animations))) (defn use-edit diff --git a/src/status_im/contexts/chat/messenger/composer/utils.cljs b/src/status_im/contexts/chat/messenger/composer/utils.cljs index 86e4d2f3d95..843bea8b4a4 100644 --- a/src/status_im/contexts/chat/messenger/composer/utils.cljs +++ b/src/status_im/contexts/chat/messenger/composer/utils.cljs @@ -86,12 +86,8 @@ (calc-bottom-content-height images link-previews?)))) (defn empty-input? - [text images link-previews? reply? audio?] - (and (empty? text) - (empty? images) - (not link-previews?) - (not reply?) - (not audio?))) + [{:keys [input-text images link-previews? reply audio edit]}] + (not (or (not-empty input-text) images link-previews? reply audio edit))) (defn blur-input [input-ref]