Filter moved from view to the subscription
This commit is contained in:
parent
483277d2bd
commit
ff2590a40f
|
@ -1103,13 +1103,16 @@
|
|||
(fn [[message-list messages pin-messages loading-messages? synced-from chat-type joined] [_ chat-id]]
|
||||
;;TODO (perf)
|
||||
(let [message-list-seq (models.message-list/->seq message-list)]
|
||||
; Don't show gaps if that's the case as we are still loading messages
|
||||
; Don't show gaps if that's the case as we are still loading messages
|
||||
(if (and (empty? message-list-seq) loading-messages?)
|
||||
[]
|
||||
(-> message-list-seq
|
||||
(chat.db/add-datemarks)
|
||||
(hydrate-messages messages pin-messages)
|
||||
(chat.db/collapse-gaps chat-id synced-from (datetime/timestamp) chat-type joined loading-messages?))))))
|
||||
(->>
|
||||
(-> message-list-seq
|
||||
(chat.db/add-datemarks)
|
||||
(hydrate-messages messages pin-messages)
|
||||
(chat.db/collapse-gaps chat-id synced-from (datetime/timestamp) chat-type joined loading-messages?))
|
||||
;; remove when the issue with messages-view chat list-key-fn is fixed
|
||||
(filter (fn [message] (some? (:message-id message)))))))))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:chats/raw-chat-pin-messages-stream
|
||||
|
|
|
@ -306,9 +306,7 @@
|
|||
|
||||
(defn messages-view [{:keys [chat bottom-space pan-responder space-keeper show-input?]}]
|
||||
(let [{:keys [group-chat chat-id public? community-id admins]} chat
|
||||
messages (->> @(re-frame/subscribe [:chats/chat-messages-stream chat-id])
|
||||
;; remove when the issue with key-fn is fixed
|
||||
(filter (fn [message] (some? (:message-id message)))))]
|
||||
messages @(re-frame/subscribe [:chats/chat-messages-stream chat-id])]
|
||||
;;do not use anonymous functions for handlers
|
||||
(when (seq messages)
|
||||
[list/bidi-flat-list
|
||||
|
|
Loading…
Reference in New Issue