From 3fc6929075d2da8c27d8ca4dc5b1632a04c27bee Mon Sep 17 00:00:00 2001 From: Tim <135014430+nagisa77@users.noreply.github.com> Date: Wed, 20 Aug 2025 20:46:08 +0800 Subject: [PATCH] Remove unread message after marking read --- frontend_nuxt/pages/message.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend_nuxt/pages/message.vue b/frontend_nuxt/pages/message.vue index 4b89b6ec5..fefc6f9e5 100644 --- a/frontend_nuxt/pages/message.vue +++ b/frontend_nuxt/pages/message.vue @@ -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