From ec2937ec1f3b0ae153f79604eb35b57ffe0f9af2 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 13 Nov 2023 17:29:25 +0200 Subject: add options for marking single notification as read --- src/modules/statuses.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/modules/statuses.js') diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 9b4cd175..6e331d16 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -17,6 +17,10 @@ import { isValidNotification, maybeShowNotification } from '../services/notification_utils/notification_utils.js' +import { + closeDesktopNotification, + closeAllDesktopNotifications +} from '../services/desktop_notification_utils/desktop_notification_utils.js' import apiService from '../services/api/api.service.js' const emptyTl = (userId = 0) => ({ @@ -726,6 +730,8 @@ const statuses = { apiService.markNotificationsAsSeen({ id: rootState.statuses.notifications.maxId, credentials: rootState.users.currentUser.credentials + }).then(() => { + closeAllDesktopNotifications(rootState) }) }, markSingleNotificationAsSeen ({ rootState, commit }, { id }) { @@ -734,6 +740,8 @@ const statuses = { single: true, id, credentials: rootState.users.currentUser.credentials + }).then(() => { + closeDesktopNotification(rootState, id) }) }, dismissNotificationLocal ({ rootState, commit }, { id }) { -- cgit v1.2.3-70-g09d2