Merge pull request #672 from nagisa77/codex/fix-immediate-deletion-of-unread-message

Remove notification after marking read
This commit is contained in:
Tim
2025-08-20 20:46:24 +08:00
committed by GitHub

View File

@@ -542,7 +542,7 @@ import {
fetchNotifications,
fetchUnreadCount,
isLoadingMessage,
markRead,
markRead as markNotificationRead,
notifications,
markAllRead,
hasMore,
@@ -597,6 +597,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