 
 (fx/defn handle-mark-all-read-successful
   {:events [::mark-all-read-successful]}
-  [{:keys [db] :as cofx} chat-id]
-  (fx/merge cofx
-            {:db (mark-chat-all-read db chat-id)}
-            (notification-center/get-activity-center-notifications-count)))
+  [cofx]
+  (notification-center/get-activity-center-notifications-count cofx))
 
 (fx/defn handle-mark-all-read-in-community-successful
   {:events [::mark-all-read-in-community-successful]}

  (when-not (get-in db [:pagination-info chat-id :messages-initialized?])
    (fx/merge cofx
              {:db (assoc-in db [:pagination-info chat-id :messages-initialized?] now)
               :utils/dispatch-later [{:ms 500 :dispatch [:chat.ui/mark-all-read-pressed chat-id]}]}
              (load-more-messages chat-id true))))

(fx/defn handle-mark-all-read
  {:events [:chat.ui/mark-all-read-pressed :chat/mark-all-as-read]}
  [{db :db} chat-id]
  {:db (mark-chat-all-read db chat-id)
   :clear-message-notifications  [[chat-id]
                                  (get-in db [:multiaccount :remote-push-notifications-enabled?])]
   ::json-rpc/call [{:method     "wakuext_markAllRead"
                     :params     [chat-id]
                     :on-success #(re-frame/dispatch [::mark-all-read-successful])}]})

(fx/defn handle-mark-mark-all-read-in-community
  {:events [:chat.ui/mark-all-read-in-community-pressed]}
