fix scroll to bottom button is shown on chat reopen (#20004)

This commit is contained in:
Parvesh Monu 2024-05-15 16:23:38 +05:30 committed by GitHub
parent f7505db6fd
commit 5ab97db795
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 10 deletions

View File

@ -23,17 +23,21 @@
(defn lazy-chat-screen (defn lazy-chat-screen
[chat-screen-layout-calculations-complete?] [chat-screen-layout-calculations-complete?]
(let [screen-loaded? (rf/sub [:shell/chat-screen-loaded?]) (let [screen-loaded? (rf/sub [:shell/chat-screen-loaded?])
props {:insets (safe-area/get-insets) distance-from-list-top (reanimated/use-shared-value 0)
:content-height (atom 0) chat-list-scroll-y (reanimated/use-shared-value 0)
:layout-height (atom 0) props {:insets (safe-area/get-insets)
:distance-atom (atom 0) :content-height (atom 0)
:distance-from-list-top (reanimated/use-shared-value 0) :layout-height (atom 0)
:chat-list-scroll-y (reanimated/use-shared-value 0) :distance-atom (atom 0)
:chat-screen-layout-calculations-complete? :distance-from-list-top distance-from-list-top
chat-screen-layout-calculations-complete?}] :chat-list-scroll-y chat-list-scroll-y
:chat-screen-layout-calculations-complete?
chat-screen-layout-calculations-complete?}]
(when-not screen-loaded? (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? (when screen-loaded?
[chat-screen props]))) [chat-screen props])))