feat: upgrade to masto.js v6 (#2530)
This commit is contained in:
parent
d8ea685803
commit
6c5bb83ac3
62 changed files with 262 additions and 263 deletions
|
@ -22,7 +22,7 @@ const { data: status, pending, refresh: refreshStatus } = useAsyncData(
|
|||
const { client } = $(useMasto())
|
||||
const { data: context, pending: pendingContext, refresh: refreshContext } = useAsyncData(
|
||||
`context:${id}`,
|
||||
async () => client.v1.statuses.fetchContext(id),
|
||||
async () => client.v1.statuses.$select(id).context.fetch(),
|
||||
{ watch: [isHydrated], immediate: isHydrated.value, lazy: true, default: () => shallowRef() },
|
||||
)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ const handle = $(computedEager(() => params.account as string))
|
|||
definePageMeta({ name: 'account-followers' })
|
||||
|
||||
const account = await fetchAccountByHandle(handle)
|
||||
const paginator = account ? useMastoClient().v1.accounts.listFollowers(account.id, {}) : null
|
||||
const paginator = account ? useMastoClient().v1.accounts.$select(account.id).followers.list() : null
|
||||
|
||||
const isSelf = useSelfAccount(account)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ const handle = $(computedEager(() => params.account as string))
|
|||
definePageMeta({ name: 'account-following' })
|
||||
|
||||
const account = await fetchAccountByHandle(handle)
|
||||
const paginator = account ? useMastoClient().v1.accounts.listFollowing(account.id, {}) : null
|
||||
const paginator = account ? useMastoClient().v1.accounts.$select(account.id).following.list() : null
|
||||
|
||||
const isSelf = useSelfAccount(account)
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ function reorderAndFilter(items: mastodon.v1.Status[]) {
|
|||
return reorderedTimeline(items, 'account')
|
||||
}
|
||||
|
||||
const paginator = useMastoClient().v1.accounts.listStatuses(account.id, { limit: 30, excludeReplies: true })
|
||||
const paginator = useMastoClient().v1.accounts.$select(account.id).statuses.list({ limit: 30, excludeReplies: true })
|
||||
|
||||
if (account) {
|
||||
useHydratedHead({
|
||||
|
|
|
@ -7,7 +7,7 @@ const handle = $(computedEager(() => params.account as string))
|
|||
|
||||
const account = await fetchAccountByHandle(handle)
|
||||
|
||||
const paginator = useMastoClient().v1.accounts.listStatuses(account.id, { onlyMedia: true, excludeReplies: false })
|
||||
const paginator = useMastoClient().v1.accounts.$select(account.id).statuses.list({ onlyMedia: true, excludeReplies: false })
|
||||
|
||||
if (account) {
|
||||
useHydratedHead({
|
||||
|
|
|
@ -7,7 +7,7 @@ const handle = $(computedEager(() => params.account as string))
|
|||
|
||||
const account = await fetchAccountByHandle(handle)
|
||||
|
||||
const paginator = useMastoClient().v1.accounts.listStatuses(account.id, { excludeReplies: false })
|
||||
const paginator = useMastoClient().v1.accounts.$select(account.id).statuses.list({ excludeReplies: false })
|
||||
|
||||
if (account) {
|
||||
useHydratedHead({
|
||||
|
|
|
@ -3,7 +3,7 @@ import { STORAGE_KEY_HIDE_EXPLORE_POSTS_TIPS } from '~~/constants'
|
|||
|
||||
const { t } = useI18n()
|
||||
|
||||
const paginator = useMastoClient().v1.trends.listStatuses()
|
||||
const paginator = useMastoClient().v1.trends.statuses.list()
|
||||
|
||||
const hideNewsTips = useLocalStorage(STORAGE_KEY_HIDE_EXPLORE_POSTS_TIPS, false)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import { STORAGE_KEY_HIDE_EXPLORE_NEWS_TIPS } from '~~/constants'
|
|||
|
||||
const { t } = useI18n()
|
||||
|
||||
const paginator = useMastoClient().v1.trends.listLinks()
|
||||
const paginator = useMastoClient().v1.trends.links.list()
|
||||
|
||||
const hideNewsTips = useLocalStorage(STORAGE_KEY_HIDE_EXPLORE_NEWS_TIPS, false)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { STORAGE_KEY_HIDE_EXPLORE_TAGS_TIPS } from '~~/constants'
|
|||
const { t } = useI18n()
|
||||
|
||||
const { client } = $(useMasto())
|
||||
const paginator = client.v1.trends.listTags({
|
||||
const paginator = client.v1.trends.tags.list({
|
||||
limit: 20,
|
||||
})
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ const tabs = $computed<CommonRouteTabOption[]>(() => [
|
|||
)
|
||||
|
||||
const { client } = $(useMasto())
|
||||
const { data: listInfo, refresh } = $(await useAsyncData(() => client.v1.lists.fetch(list), { default: () => shallowRef() }))
|
||||
const { data: listInfo, refresh } = $(await useAsyncData(() => client.v1.lists.$select(list).fetch(), { default: () => shallowRef() }))
|
||||
|
||||
if (listInfo) {
|
||||
useHydratedHead({
|
||||
|
|
|
@ -6,7 +6,7 @@ definePageMeta({
|
|||
const params = useRoute().params
|
||||
const listId = $(computedEager(() => params.list as string))
|
||||
|
||||
const paginator = useMastoClient().v1.lists.listAccounts(listId)
|
||||
const paginator = useMastoClient().v1.lists.$select(listId).accounts.list()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -8,8 +8,8 @@ const listId = $(computedEager(() => params.list as string))
|
|||
|
||||
const client = useMastoClient()
|
||||
|
||||
const paginator = client.v1.timelines.listList(listId)
|
||||
const stream = useStreaming(client => client.v1.stream.streamListTimeline(listId))
|
||||
const paginator = client.v1.timelines.list.$select(listId).list()
|
||||
const stream = useStreaming(client => client.list.subscribe({ list: listId }))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -7,10 +7,10 @@ const params = useRoute().params
|
|||
const tagName = $(computedEager(() => params.tag as string))
|
||||
|
||||
const { client } = $(useMasto())
|
||||
const { data: tag, refresh } = $(await useAsyncData(() => client.v1.tags.fetch(tagName), { default: () => shallowRef() }))
|
||||
const { data: tag, refresh } = $(await useAsyncData(() => client.v1.tags.$select(tagName).fetch(), { default: () => shallowRef() }))
|
||||
|
||||
const paginator = client.v1.timelines.listHashtag(tagName)
|
||||
const stream = useStreaming(client => client.v1.stream.streamTagTimeline(tagName))
|
||||
const paginator = client.v1.timelines.tag.$select(tagName).list()
|
||||
const stream = useStreaming(client => client.hashtag.subscribe({ tag: tagName }))
|
||||
|
||||
if (tag) {
|
||||
useHydratedHead({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue