mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-06 23:21:16 +08:00
Merge pull request #672 from nagisa77/codex/fix-immediate-deletion-of-unread-message
Remove notification after marking read
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user