Fix merging of :message/message-persisted event
Previously `:message/message-persisted` was dispatched for each incoming message because its argument was not a vector. The event was renamed to `:message/messages-persisted`.
This commit is contained in:
parent
4981f4c346
commit
8754f72eba
|
@ -21,4 +21,4 @@
|
||||||
db
|
db
|
||||||
statuses)
|
statuses)
|
||||||
:data-store/tx [{:transaction (user-statuses-store/save-statuses-tx statuses)
|
:data-store/tx [{:transaction (user-statuses-store/save-statuses-tx statuses)
|
||||||
:success-event [:message/message-persisted js-obj]}]})))
|
:success-event [:message/messages-persisted [js-obj]]}]})))
|
||||||
|
|
|
@ -139,7 +139,8 @@
|
||||||
:data-store/tx [(merge
|
:data-store/tx [(merge
|
||||||
{:transaction (messages-store/save-message-tx prepared-message)}
|
{:transaction (messages-store/save-message-tx prepared-message)}
|
||||||
(when raw-message
|
(when raw-message
|
||||||
{:success-event [:message/message-persisted raw-message]}))]}
|
{:success-event
|
||||||
|
[:message/messages-persisted [raw-message]]}))]}
|
||||||
(when (and platform/desktop?
|
(when (and platform/desktop?
|
||||||
(not batch?)
|
(not batch?)
|
||||||
(not (system-message? prepared-message)))
|
(not (system-message? prepared-message)))
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
[merged-values]))]))))))
|
[merged-values]))]))))))
|
||||||
|
|
||||||
(defn- merge-persistence-events [success-events]
|
(defn- merge-persistence-events [success-events]
|
||||||
(merge-events-of-type success-events :message/message-persisted))
|
(merge-events-of-type success-events :message/messages-persisted))
|
||||||
|
|
||||||
(defn- perform-transactions [raw-transactions realm]
|
(defn- perform-transactions [raw-transactions realm]
|
||||||
(let [success-events (keep :success-event raw-transactions)
|
(let [success-events (keep :success-event raw-transactions)
|
||||||
|
|
|
@ -791,9 +791,14 @@
|
||||||
(chat.message/update-message-status cofx chat-id message-id status)))
|
(chat.message/update-message-status cofx chat-id message-id status)))
|
||||||
|
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
:message/message-persisted
|
:message/messages-persisted
|
||||||
(fn [cofx [_ raw-message]]
|
(fn [cofx [_ raw-messages]]
|
||||||
(chat.message/confirm-message-processed cofx raw-message)))
|
(apply fx/merge
|
||||||
|
cofx
|
||||||
|
(map
|
||||||
|
(fn [raw-message]
|
||||||
|
(chat.message/confirm-message-processed raw-message))
|
||||||
|
raw-messages))))
|
||||||
|
|
||||||
;; signal module
|
;; signal module
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue