diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index 6dbd714f8..c200711a7 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -36,6 +36,14 @@ + + {{ $t('notification.markAllRead') }} +

{{ $t('notification.none') }}
@@ -60,11 +68,15 @@ import {closeWhenClickedOutside} from '@/helpers/closeWhenClickedOutside' import {formatDateLong, formatDateSince} from '@/helpers/time/formatDate' import {getDisplayName} from '@/models/user' import {useAuthStore} from '@/stores/auth' +import XButton from '@/components/input/button.vue' +import {success} from '@/message' +import {useI18n} from 'vue-i18n' const LOAD_NOTIFICATIONS_INTERVAL = 10000 const authStore = useAuthStore() const router = useRouter() +const {t} = useI18n() const allNotifications = ref([]) const showNotifications = ref(false) @@ -138,6 +150,12 @@ function to(n, index) { allNotifications.value[index] = await notificationService.update(n) } } + +async function markAllRead() { + const notificationService = new NotificationService() + await notificationService.markAllRead() + success({message: t('notification.markAllReadSuccess')}) +}