diff --git a/frontend_nuxt/components/GlobalPopups.vue b/frontend_nuxt/components/GlobalPopups.vue index f5d87b2eb..3c31e8d9c 100644 --- a/frontend_nuxt/components/GlobalPopups.vue +++ b/frontend_nuxt/components/GlobalPopups.vue @@ -95,7 +95,6 @@ const closeMilkTeaPopup = () => { if (!process.client) return localStorage.setItem('milkTeaActivityPopupShown', 'true') showMilkTeaPopup.value = false - checkNotificationSetting() } const checkNotificationSetting = async () => { @@ -108,7 +107,6 @@ const closeNotificationPopup = () => { if (!process.client) return localStorage.setItem('notificationSettingPopupShown', 'true') showNotificationPopup.value = false - checkNewMedals() } const checkNewMedals = async () => { if (!process.client) return diff --git a/frontend_nuxt/pages/message.vue b/frontend_nuxt/pages/message.vue index 861799d01..3a8098f3b 100644 --- a/frontend_nuxt/pages/message.vue +++ b/frontend_nuxt/pages/message.vue @@ -542,7 +542,7 @@ import { fetchNotifications, fetchUnreadCount, isLoadingMessage, - markRead as markNotificationRead, + markNotificationRead, notifications, markAllRead, hasMore, @@ -598,7 +598,7 @@ const togglePref = async (pref) => { } const markRead = async (id) => { - await markNotificationRead(id) + markNotificationRead(id) if (selectedTab.value === 'unread') { const index = notifications.value.findIndex((n) => n.id === id) if (index !== -1) notifications.value.splice(index, 1) diff --git a/frontend_nuxt/utils/notification.js b/frontend_nuxt/utils/notification.js index a7f3c3016..e476d9fb1 100644 --- a/frontend_nuxt/utils/notification.js +++ b/frontend_nuxt/utils/notification.js @@ -159,7 +159,7 @@ function createFetchNotifications() { ...n, src: n.comment.author.avatar, iconClick: () => { - markRead(n.id) + markNotificationRead(n.id) navigateTo(`/users/${n.comment.author.id}`, { replace: true }) }, }) @@ -169,7 +169,7 @@ function createFetchNotifications() { emoji: reactionEmojiMap[n.reactionType], iconClick: () => { if (n.fromUser) { - markRead(n.id) + markNotificationRead(n.id) navigateTo(`/users/${n.fromUser.id}`, { replace: true }) } }, @@ -181,7 +181,7 @@ function createFetchNotifications() { icon: n.fromUser ? undefined : iconMap[n.type], iconClick: () => { if (n.fromUser) { - markRead(n.id) + markNotificationRead(n.id) navigateTo(`/users/${n.fromUser.id}`, { replace: true }) } }, @@ -193,7 +193,7 @@ function createFetchNotifications() { icon: n.fromUser ? undefined : iconMap[n.type], iconClick: () => { if (n.fromUser) { - markRead(n.id) + markNotificationRead(n.id) navigateTo(`/users/${n.fromUser.id}`, { replace: true }) } }, @@ -204,7 +204,7 @@ function createFetchNotifications() { icon: iconMap[n.type], iconClick: () => { if (n.post) { - markRead(n.id) + markNotificationRead(n.id) navigateTo(`/posts/${n.post.id}`) } }, @@ -214,7 +214,7 @@ function createFetchNotifications() { ...n, src: n.comment.author.avatar, iconClick: () => { - markRead(n.id) + markNotificationRead(n.id) navigateTo(`/users/${n.comment.author.id}`, { replace: true }) }, }) @@ -224,7 +224,7 @@ function createFetchNotifications() { icon: iconMap[n.type], iconClick: () => { if (n.fromUser) { - markRead(n.id) + markNotificationRead(n.id) navigateTo(`/users/${n.fromUser.id}`, { replace: true }) } }, @@ -235,7 +235,7 @@ function createFetchNotifications() { icon: iconMap[n.type], iconClick: () => { if (n.fromUser) { - markRead(n.id) + markNotificationRead(n.id) navigateTo(`/users/${n.fromUser.id}`, { replace: true }) } }, @@ -250,7 +250,7 @@ function createFetchNotifications() { icon: iconMap[n.type], iconClick: () => { if (n.post) { - markRead(n.id) + markNotificationRead(n.id) navigateTo(`/posts/${n.post.id}`, { replace: true }) } }, @@ -262,7 +262,7 @@ function createFetchNotifications() { icon: n.fromUser ? undefined : iconMap[n.type], iconClick: () => { if (n.post) { - markRead(n.id) + markNotificationRead(n.id) navigateTo(`/posts/${n.post.id}`, { replace: true }) } }, @@ -290,7 +290,7 @@ function createFetchNotifications() { } } - const markRead = async (id) => { + const markNotificationRead = async (id) => { if (!id) return const n = notifications.value.find((n) => n.id === id) if (!n || n.read) return @@ -332,7 +332,7 @@ function createFetchNotifications() { } return { fetchNotifications, - markRead, + markNotificationRead, notifications, isLoadingMessage, markAllRead, @@ -342,7 +342,7 @@ function createFetchNotifications() { export const { fetchNotifications, - markRead, + markNotificationRead, notifications, isLoadingMessage, markAllRead,