fix: update notification count on sidebar after they are read

This commit is contained in:
Raizaaa
2026-04-29 23:51:32 +05:30
parent bb5e277e9e
commit 7fecbe5799
+7
View File
@@ -169,6 +169,7 @@ import {
Button,
createListResource,
createResource,
getCachedResource,
TabButtons,
usePageMeta,
} from 'frappe-ui'
@@ -219,6 +220,10 @@ const readNotifications = createListResource({
cache: 'Read Notifications',
})
const refreshSidebarCount = () => {
getCachedResource('Unread Notifications Count')?.reload()
}
const markAsRead = createResource({
url: 'frappe.desk.doctype.notification_log.notification_log.mark_as_read',
makeParams(values) {
@@ -229,6 +234,7 @@ const markAsRead = createResource({
onSuccess(data) {
unReadNotifications.reload()
readNotifications.reload()
refreshSidebarCount()
},
})
@@ -237,6 +243,7 @@ const markAllAsRead = createResource({
onSuccess(data) {
unReadNotifications.reload()
readNotifications.reload()
refreshSidebarCount()
},
})