Filter moved from view to the subscription
This commit is contained in:
parent
483277d2bd
commit
ff2590a40f
|
@ -1106,10 +1106,13 @@
|
||||||
; 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?)
|
(if (and (empty? message-list-seq) loading-messages?)
|
||||||
[]
|
[]
|
||||||
|
(->>
|
||||||
(-> message-list-seq
|
(-> message-list-seq
|
||||||
(chat.db/add-datemarks)
|
(chat.db/add-datemarks)
|
||||||
(hydrate-messages messages pin-messages)
|
(hydrate-messages messages pin-messages)
|
||||||
(chat.db/collapse-gaps chat-id synced-from (datetime/timestamp) chat-type joined loading-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
|
(re-frame/reg-sub
|
||||||
:chats/raw-chat-pin-messages-stream
|
:chats/raw-chat-pin-messages-stream
|
||||||
|
|
|
@ -306,9 +306,7 @@
|
||||||
|
|
||||||
(defn messages-view [{:keys [chat bottom-space pan-responder space-keeper show-input?]}]
|
(defn messages-view [{:keys [chat bottom-space pan-responder space-keeper show-input?]}]
|
||||||
(let [{:keys [group-chat chat-id public? community-id admins]} chat
|
(let [{:keys [group-chat chat-id public? community-id admins]} chat
|
||||||
messages (->> @(re-frame/subscribe [:chats/chat-messages-stream chat-id])
|
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)))))]
|
|
||||||
;;do not use anonymous functions for handlers
|
;;do not use anonymous functions for handlers
|
||||||
(when (seq messages)
|
(when (seq messages)
|
||||||
[list/bidi-flat-list
|
[list/bidi-flat-list
|
||||||
|
|
Loading…
Reference in New Issue