refactor: initialise masto outside of functions/handlers

This commit is contained in:
Daniel Roe 2022-12-25 15:04:50 +01:00
parent 03d3775011
commit 720b5114af
No known key found for this signature in database
GPG key ID: 22D5008E4F5D9B55
13 changed files with 44 additions and 30 deletions

View file

@ -1,13 +1,14 @@
<script setup lang="ts">
const { t } = useI18n()
const masto = useMasto()
// Default limit is 20 notifications, and servers are normally caped to 30
const paginator = useMasto().notifications.iterate({ limit: 30, types: ['mention'] })
const paginator = masto.notifications.iterate({ limit: 30, types: ['mention'] })
const { clearNotifications } = useNotifications()
onActivated(clearNotifications)
const stream = await useMasto().stream.streamUser()
const stream = await masto.stream.streamUser()
useHeadFixed({
title: () => `${t('tab.notifications_mention')} | ${t('nav_side.notifications')}`,