mirror of
https://github.com/frappe/lms.git
synced 2026-05-02 13:39:31 +03:00
Merge pull request #2338 from raizasafeel/fix/notification
fix: update notification count on sidebar after they are read
This commit is contained in:
@@ -674,6 +674,7 @@ watch(settingsStore.settings, () => {
|
||||
const updateSidebarLinks = () => {
|
||||
sidebarLinks.value = getSidebarLinks()
|
||||
updateSidebarLinksVisibility()
|
||||
updateUnreadCount()
|
||||
}
|
||||
|
||||
const redirectToWebsite = () => {
|
||||
|
||||
@@ -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()
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user