Remove unread message after marking read

This commit is contained in:
Tim
2025-08-20 20:46:08 +08:00
parent 91ffacc335
commit 3fc6929075

View File

@@ -524,7 +524,7 @@ import {
fetchNotifications,
fetchUnreadCount,
isLoadingMessage,
markRead,
markRead as markNotificationRead,
notifications,
markAllRead,
hasMore,
@@ -579,6 +579,14 @@ const togglePref = async (pref) => {
}
}
const markRead = async (id) => {
await markNotificationRead(id)
if (selectedTab.value === 'unread') {
const index = notifications.value.findIndex((n) => n.id === id)
if (index !== -1) notifications.value.splice(index, 1)
}
}
const approve = async (id, nid) => {
const token = getToken()
if (!token) return