refactor: remove deprecated masto API

zio/stable
三咲智子 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' }) definePageMeta({ name: 'account-followers' })
const account = await fetchAccountByHandle(handle) const account = await fetchAccountByHandle(handle)
const paginator = account ? useMasto().accounts.getFollowersIterable(account.id, {}) : null const paginator = account ? useMasto().accounts.iterateFollowers(account.id, {}) : null
</script> </script>
<template> <template>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@ definePageMeta({
middleware: 'auth', 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() const { t } = useI18n()
useHeadFixed({ useHeadFixed({

View File

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

View File

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