2023-09-06 10:13:16 +01:00
|
|
|
<script setup lang="ts">
|
|
|
|
import type { mastodon } from 'masto'
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
2024-02-21 15:20:08 +00:00
|
|
|
const filter = computed<mastodon.v1.NotificationType | undefined>(() => {
|
2023-09-06 10:13:16 +01:00
|
|
|
if (!isHydrated.value)
|
|
|
|
return undefined
|
|
|
|
|
|
|
|
const rawFilter = route.params?.filter
|
|
|
|
const actualFilter = Array.isArray(rawFilter) ? rawFilter[0] : rawFilter
|
|
|
|
if (isNotification(actualFilter))
|
|
|
|
return actualFilter
|
2024-03-11 10:53:25 +00:00
|
|
|
|
|
|
|
return undefined
|
2023-09-06 10:13:16 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
useHydratedHead({
|
2024-02-24 14:18:13 +00:00
|
|
|
title: () => `${t(`tab.notifications_${filter.value ?? 'all'}`)} | ${t('nav.notifications')}`,
|
2023-09-06 10:13:16 +01:00
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<TimelineNotifications v-if="isHydrated" :filter="filter" />
|
|
|
|
</template>
|