fix: mark all notifications as read not work (#18107)
This commit is contained in:
parent
9ff70ed990
commit
78576f4aeb
|
@ -156,14 +156,20 @@
|
|||
:on-error [:activity-center/process-notification-failure nil
|
||||
:notification/mark-all-as-read]}]})))
|
||||
|
||||
(rf/defn mark-all-as-read-success
|
||||
{:events [:activity-center.notifications/mark-all-as-read-success]}
|
||||
[{:keys [db]}]
|
||||
(defn merge-chats
|
||||
[db chats]
|
||||
(update db :chats merge (collection/index-by :chat-id chats)))
|
||||
|
||||
(defn mark-all-as-read-success
|
||||
[{:keys [db]} [{:keys [chats] :as _messenger-response}]]
|
||||
{:db (-> (reduce (fn [acc notification-type]
|
||||
(assoc-in acc [:activity-center :unread-counts-by-type notification-type] 0))
|
||||
db
|
||||
types/all-supported)
|
||||
(update :activity-center dissoc :mark-all-as-read-undoable-till))})
|
||||
(update :activity-center dissoc :mark-all-as-read-undoable-till)
|
||||
(merge-chats (map data-store.chats/<-rpc chats)))})
|
||||
|
||||
(rf/reg-event-fx :activity-center.notifications/mark-all-as-read-success mark-all-as-read-success)
|
||||
|
||||
(rf/defn undo-mark-all-as-read
|
||||
{:events [:activity-center.notifications/undo-mark-all-as-read-locally]}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "v0.171.39",
|
||||
"commit-sha1": "debfe1cab368140b16d2383efc68007d3c28a4ef",
|
||||
"src-sha256": "0cbj3796qz69ylwcvdw5jsl1cdyrcfk81d7shjkakvjh59rv5sjk"
|
||||
"version": "v0.172.2",
|
||||
"commit-sha1": "5cb1972261de90fee1469ae60ffb7f25900a9850",
|
||||
"src-sha256": "1z37yinlxwpzprd10h2f4vzs5k2a1k85ks9lvl067lb4rqflcwny"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue