elk/pages/notifications/[filter].vue
Ayo Ayco 907d9999dc
feat: filter notifications by type (#2371)
Co-authored-by: Xabi <xabi.rn@gmail.com>
Co-authored-by: userquin <userquin@gmail.com>
2023-09-06 09:13:16 +00:00

25 lines
625 B
Vue

<script setup lang="ts">
import type { mastodon } from 'masto'
const route = useRoute()
const { t } = useI18n()
const filter = $computed<mastodon.v1.NotificationType | undefined>(() => {
if (!isHydrated.value)
return undefined
const rawFilter = route.params?.filter
const actualFilter = Array.isArray(rawFilter) ? rawFilter[0] : rawFilter
if (isNotification(actualFilter))
return actualFilter
})
useHydratedHead({
title: () => `${t(`tab.notifications_${filter ?? 'all'}`)} | ${t('nav.notifications')}`,
})
</script>
<template>
<TimelineNotifications v-if="isHydrated" :filter="filter" />
</template>