mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-23 04:27:26 +08:00
Remove unread message after marking read
This commit is contained in:
@@ -524,7 +524,7 @@ import {
|
|||||||
fetchNotifications,
|
fetchNotifications,
|
||||||
fetchUnreadCount,
|
fetchUnreadCount,
|
||||||
isLoadingMessage,
|
isLoadingMessage,
|
||||||
markRead,
|
markRead as markNotificationRead,
|
||||||
notifications,
|
notifications,
|
||||||
markAllRead,
|
markAllRead,
|
||||||
hasMore,
|
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 approve = async (id, nid) => {
|
||||||
const token = getToken()
|
const token = getToken()
|
||||||
if (!token) return
|
if (!token) return
|
||||||
|
|||||||
Reference in New Issue
Block a user