refactor: sync masto (#1121)
This commit is contained in:
parent
eb1f769e32
commit
4422a57f49
81 changed files with 397 additions and 367 deletions
|
@ -15,13 +15,13 @@ const publishWidget = ref()
|
|||
const { data: status, pending, refresh: refreshStatus } = useAsyncData(
|
||||
`status:${id}`,
|
||||
() => fetchStatus(id),
|
||||
{ watch: [isMastoInitialised], immediate: isMastoInitialised.value },
|
||||
{ watch: [isHydrated], immediate: isHydrated.value },
|
||||
)
|
||||
const masto = useMasto()
|
||||
const { client } = $(useMasto())
|
||||
const { data: context, pending: pendingContext, refresh: refreshContext } = useAsyncData(
|
||||
`context:${id}`,
|
||||
async () => masto.v1.statuses.fetchContext(id),
|
||||
{ watch: [isMastoInitialised], immediate: isMastoInitialised.value },
|
||||
async () => client.v1.statuses.fetchContext(id),
|
||||
{ watch: [isHydrated], immediate: isHydrated.value },
|
||||
)
|
||||
|
||||
const replyDraft = $computed(() => status.value ? getReplyDraft(status.value) : null)
|
||||
|
|
|
@ -8,7 +8,7 @@ const accountName = $(computedEager(() => toShortHandle(params.account as string
|
|||
|
||||
const { t } = useI18n()
|
||||
|
||||
const { data: account, pending, refresh } = $(await useAsyncData(() => fetchAccountByHandle(accountName).catch(() => null), { watch: [isMastoInitialised], immediate: isMastoInitialised.value }))
|
||||
const { data: account, pending, refresh } = $(await useAsyncData(() => fetchAccountByHandle(accountName).catch(() => null), { immediate: process.client }))
|
||||
const relationship = $computed(() => account ? useRelationship(account).value : undefined)
|
||||
|
||||
onReactivated(() => {
|
||||
|
|
|
@ -6,7 +6,7 @@ const handle = $(computedEager(() => params.account as string))
|
|||
definePageMeta({ name: 'account-followers' })
|
||||
|
||||
const account = await fetchAccountByHandle(handle)
|
||||
const paginator = account ? useMasto().v1.accounts.listFollowers(account.id, {}) : null
|
||||
const paginator = account ? useMastoClient().v1.accounts.listFollowers(account.id, {}) : 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 ? useMasto().v1.accounts.listFollowing(account.id, {}) : null
|
||||
const paginator = account ? useMastoClient().v1.accounts.listFollowing(account.id, {}) : null
|
||||
|
||||
const isSelf = useSelfAccount(account)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ const { t } = useI18n()
|
|||
|
||||
const account = await fetchAccountByHandle(handle)
|
||||
|
||||
const paginator = useMasto().v1.accounts.listStatuses(account.id, { limit: 30, excludeReplies: true })
|
||||
const paginator = useMastoClient().v1.accounts.listStatuses(account.id, { limit: 30, excludeReplies: true })
|
||||
|
||||
if (account) {
|
||||
useHeadFixed({
|
||||
|
|
|
@ -7,7 +7,7 @@ const handle = $(computedEager(() => params.account as string))
|
|||
|
||||
const account = await fetchAccountByHandle(handle)
|
||||
|
||||
const paginator = useMasto().v1.accounts.listStatuses(account.id, { onlyMedia: true, excludeReplies: false })
|
||||
const paginator = useMastoClient().v1.accounts.listStatuses(account.id, { onlyMedia: true, excludeReplies: false })
|
||||
|
||||
if (account) {
|
||||
useHeadFixed({
|
||||
|
|
|
@ -7,7 +7,7 @@ const handle = $(computedEager(() => params.account as string))
|
|||
|
||||
const account = await fetchAccountByHandle(handle)
|
||||
|
||||
const paginator = useMasto().v1.accounts.listStatuses(account.id, { excludeReplies: false })
|
||||
const paginator = useMastoClient().v1.accounts.listStatuses(account.id, { excludeReplies: false })
|
||||
|
||||
if (account) {
|
||||
useHeadFixed({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue