Merge pull request #2338 from raizasafeel/fix/notification

fix: update notification count on sidebar after they are read
This commit is contained in:
Raizaaa
2026-04-30 00:23:47 +05:30
committed by GitHub
2 changed files with 8 additions and 0 deletions
@@ -674,6 +674,7 @@ watch(settingsStore.settings, () => {
const updateSidebarLinks = () => {
sidebarLinks.value = getSidebarLinks()
updateSidebarLinksVisibility()
updateUnreadCount()
}
const redirectToWebsite = () => {
+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()
},
})