diff --git a/src/status_im2/contexts/chat/composer/actions/view.cljs b/src/status_im2/contexts/chat/composer/actions/view.cljs index 61173f4a10..6a7eb8cb6a 100644 --- a/src/status_im2/contexts/chat/composer/actions/view.cljs +++ b/src/status_im2/contexts/chat/composer/actions/view.cljs @@ -58,9 +58,9 @@ :i/arrow-up]]) (defn send-button - [{:keys [text-value] :as state} animations window-height images?] + [state animations window-height images?] (let [btn-opacity (reanimated/use-shared-value 0) - z-index (reagent/atom (if (and (empty? @text-value) (not images?)) 0 1))] + z-index (reagent/atom 0)] [:f> f-send-button state animations window-height images? btn-opacity z-index])) (defn audio-button diff --git a/src/status_im2/contexts/chat/composer/effects.cljs b/src/status_im2/contexts/chat/composer/effects.cljs index 607996ab7e..da84eb1f3c 100644 --- a/src/status_im2/contexts/chat/composer/effects.cljs +++ b/src/status_im2/contexts/chat/composer/effects.cljs @@ -83,9 +83,10 @@ (reanimated/animate container-opacity 1))) (defn empty-effect - [{:keys [container-opacity]} + [{:keys [focused?]} + {:keys [container-opacity]} {:keys [input-text images link-previews? reply audio]}] - (when (utils/empty-input? input-text images link-previews? reply audio) + (when (and (not @focused?) (utils/empty-input? input-text images link-previews? reply audio)) (reanimated/animate-delay container-opacity constants/empty-opacity 200))) (defn component-will-unmount @@ -102,7 +103,7 @@ (fn [] ;; Some subscriptions can arrive after the composer if focused (esp. link ;; previews), so we need to react to changes in `max-height` outside of the - ;; `on-focus` handler + ;; `on-focus` handler. (when @focused? (let [new-height (min max-height (reanimated/get-shared-value last-height))] (reanimated/set-shared-value last-height new-height) @@ -124,7 +125,7 @@ (images-effect props animations images) (link-preview-effect state) (audio-effect state animations audio) - (empty-effect animations subs) + (empty-effect state animations subs) (kb/add-kb-listeners props state animations dimensions) #(component-will-unmount props)) [max-height]))