1
0

refactor: remove deprecated masto API

This commit is contained in:
三咲智子 2022-12-03 13:36:10 +08:00
parent cc945c4827
commit fff13ee19c
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
15 changed files with 18 additions and 18 deletions

View File

@ -5,7 +5,7 @@ const handle = $(computedEager(() => params.account as string))
definePageMeta({ name: 'account-followers' })
const account = await fetchAccountByHandle(handle)
const paginator = account ? useMasto().accounts.getFollowersIterable(account.id, {}) : null
const paginator = account ? useMasto().accounts.iterateFollowers(account.id, {}) : null
</script>
<template>

View File

@ -5,7 +5,7 @@ const handle = $(computedEager(() => params.account as string))
definePageMeta({ name: 'account-following' })
const account = await fetchAccountByHandle(handle)
const paginator = account ? useMasto().accounts.getFollowingIterable(account.id, {}) : null
const paginator = account ? useMasto().accounts.iterateFollowing(account.id, {}) : null
</script>
<template>

View File

@ -12,9 +12,9 @@ const { data: account } = await useAsyncData(`account:${handle}`, async () => (
)
const { t } = useI18n()
const paginatorPosts = useMasto().accounts.getStatusesIterable(account.value!.id, { excludeReplies: true })
const paginatorPostsWithReply = useMasto().accounts.getStatusesIterable(account.value!.id, { excludeReplies: false })
const paginatorMedia = useMasto().accounts.getStatusesIterable(account.value!.id, { onlyMedia: true, excludeReplies: false })
const paginatorPosts = useMasto().accounts.iterateStatuses(account.value!.id, { excludeReplies: true })
const paginatorPostsWithReply = useMasto().accounts.iterateStatuses(account.value!.id, { excludeReplies: false })
const paginatorMedia = useMasto().accounts.iterateStatuses(account.value!.id, { onlyMedia: true, excludeReplies: false })
const tabs = $computed(() => [
{

View File

@ -3,7 +3,7 @@ definePageMeta({
middleware: 'auth',
})
const paginator = useMasto().blocks.getIterator()
const paginator = useMasto().blocks.iterate()
useHeadFixed({
title: 'Blocked users',

View File

@ -3,7 +3,7 @@ definePageMeta({
middleware: 'auth',
})
const paginator = useMasto().bookmarks.getIterator()
const paginator = useMasto().bookmarks.iterate()
const { t } = useI18n()

View File

@ -3,7 +3,7 @@ definePageMeta({
middleware: 'auth',
})
const paginator = useMasto().conversations.getIterator()
const paginator = useMasto().conversations.iterate()
const { t } = useI18n()

View File

@ -3,7 +3,7 @@ definePageMeta({
middleware: 'auth',
})
const paginator = useMasto().domainBlocks.getIterator()
const paginator = useMasto().domainBlocks.iterate()
useHeadFixed({
title: 'Blocked domains',

View File

@ -3,7 +3,7 @@ definePageMeta({
middleware: 'auth',
})
const paginator = useMasto().favourites.getIterator()
const paginator = useMasto().favourites.iterate()
const { t } = useI18n()
useHeadFixed({

View File

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

View File

@ -3,7 +3,7 @@ definePageMeta({
middleware: 'auth',
})
const paginator = useMasto().mutes.getIterator()
const paginator = useMasto().mutes.iterate()
useHeadFixed({
title: 'Muted users',

View File

@ -5,8 +5,8 @@ definePageMeta({
const { t } = useI18n()
const paginatorAll = useMasto().notifications.getIterator()
const paginatorMention = useMasto().notifications.getIterator({ types: ['mention'] })
const paginatorAll = useMasto().notifications.iterate()
const paginatorMention = useMasto().notifications.iterate({ types: ['mention'] })
const { clearNotifications } = useNotifications()
onActivated(clearNotifications)

View File

@ -3,7 +3,7 @@ definePageMeta({
middleware: 'auth',
})
const paginator = useMasto().accounts.getStatusesIterable(currentUser.value!.account.id, { pinned: true })
const paginator = useMasto().accounts.iterateStatuses(currentUser.value!.account.id, { pinned: true })
const { t } = useI18n()
useHeadFixed({

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
const paginator = useMasto().timelines.getPublicIterable()
const paginator = useMasto().timelines.iteratePublic()
const stream = await useMasto().stream.streamPublicTimeline()
onBeforeUnmount(() => stream.disconnect())

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
const paginator = useMasto().timelines.getPublicIterable({ local: true })
const paginator = useMasto().timelines.iteratePublic({ local: true })
const stream = await useMasto().stream.streamCommunityTimeline()
onBeforeUnmount(() => stream.disconnect())

View File

@ -4,7 +4,7 @@ const tagName = $(computedEager(() => params.tag as string))
const { data: tag, refresh } = $(await useAsyncData(() => useMasto().tags.fetch(tagName)))
const paginator = useMasto().timelines.getHashtagIterable(tagName)
const paginator = useMasto().timelines.iterateHashtag(tagName)
const stream = await useMasto().stream.streamTagTimeline(tagName)
onBeforeUnmount(() => stream.disconnect())