From 5ab97db795f23bec3ac5020f4c2381a48b4af9a7 Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Wed, 15 May 2024 16:23:38 +0530 Subject: [PATCH] fix scroll to bottom button is shown on chat reopen (#20004) --- .../chat/messenger/messages/view.cljs | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/status_im/contexts/chat/messenger/messages/view.cljs b/src/status_im/contexts/chat/messenger/messages/view.cljs index a98d1602e8..8f1254ccd2 100644 --- a/src/status_im/contexts/chat/messenger/messages/view.cljs +++ b/src/status_im/contexts/chat/messenger/messages/view.cljs @@ -23,17 +23,21 @@ (defn lazy-chat-screen [chat-screen-layout-calculations-complete?] - (let [screen-loaded? (rf/sub [:shell/chat-screen-loaded?]) - props {:insets (safe-area/get-insets) - :content-height (atom 0) - :layout-height (atom 0) - :distance-atom (atom 0) - :distance-from-list-top (reanimated/use-shared-value 0) - :chat-list-scroll-y (reanimated/use-shared-value 0) - :chat-screen-layout-calculations-complete? - chat-screen-layout-calculations-complete?}] + (let [screen-loaded? (rf/sub [:shell/chat-screen-loaded?]) + distance-from-list-top (reanimated/use-shared-value 0) + chat-list-scroll-y (reanimated/use-shared-value 0) + props {:insets (safe-area/get-insets) + :content-height (atom 0) + :layout-height (atom 0) + :distance-atom (atom 0) + :distance-from-list-top distance-from-list-top + :chat-list-scroll-y chat-list-scroll-y + :chat-screen-layout-calculations-complete? + chat-screen-layout-calculations-complete?}] (when-not screen-loaded? - (reanimated/set-shared-value chat-screen-layout-calculations-complete? false)) + (reanimated/set-shared-value chat-screen-layout-calculations-complete? false) + (reanimated/set-shared-value distance-from-list-top 0) + (reanimated/set-shared-value chat-list-scroll-y 0)) (when screen-loaded? [chat-screen props])))