Test commit for inverted feature

This commit is contained in:
Vitaliy Vlasov 2018-09-13 12:19:56 +03:00
parent 33da59f859
commit d9e7d7c887
No known key found for this signature in database
GPG Key ID: A7D57C347F2B2964
1 changed files with 3 additions and 2 deletions

View File

@ -156,12 +156,13 @@
scroll-height (atom nil)
_ (when (or (not @chat-id*) (not= @chat-id* chat-id))
(reset! chat-id* chat-id)
(js/setTimeout #(when @scroll-ref (.scrollToEnd @scroll-ref)) 400))]
#_(js/setTimeout #(when @scroll-ref (.scrollToEnd @scroll-ref)) 400))]
[react/view {:style styles/messages-view}
[react/scroll-view {:scrollEventThrottle 16
:headerHeight styles/messages-list-vertical-padding
:footerWidth styles/messages-list-vertical-padding
:enableArrayScrollingOptimization true
:inverted true
:on-scroll (fn [e]
(let [ne (.-nativeEvent e)
y (.-y (.-contentOffset ne))]
@ -173,7 +174,7 @@
:ref #(reset! scroll-ref %)}
[react/view
(doall
(for [[index {:keys [from content message-id type value] :as message-obj}] (map-indexed vector (reverse messages))]
(for [[index {:keys [from content message-id type value] :as message-obj}] (map-indexed vector messages)]
^{:key message-obj}
[message content (= from current-public-key)
(assoc message-obj :group-chat group-chat