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

@ -11,8 +11,9 @@ if (useRoute().path === '/signin/callback') {
useRouter().push('/home')
}
const paginator = useMasto().timelines.iterateHome()
const stream = await useMasto().stream.streamUser()
const masto = useMasto()
const paginator = masto.timelines.iterateHome()
const stream = await masto.stream.streamUser()
onBeforeUnmount(() => stream.disconnect())
const { t } = useI18n()