feat(account): predict relationship from context

This commit is contained in:
三咲智子 2023-01-10 15:49:49 +08:00
parent b4cda4338f
commit 88731ee18d
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
6 changed files with 20 additions and 10 deletions

View file

@ -8,6 +8,8 @@ definePageMeta({ name: 'account-followers' })
const account = await fetchAccountByHandle(handle)
const paginator = account ? useMasto().v1.accounts.listFollowers(account.id, {}) : null
const isSelf = useSelfAccount(account)
if (account) {
useHeadFixed({
title: () => `${t('account.followers')} | ${getDisplayName(account)} (@${account})`,
@ -17,6 +19,6 @@ if (account) {
<template>
<template v-if="paginator">
<AccountPaginator :paginator="paginator" />
<AccountPaginator :paginator="paginator" :relationship-context="isSelf ? 'followedBy' : undefined" />
</template>
</template>

View file

@ -8,6 +8,8 @@ definePageMeta({ name: 'account-following' })
const account = await fetchAccountByHandle(handle)
const paginator = account ? useMasto().v1.accounts.listFollowing(account.id, {}) : null
const isSelf = useSelfAccount(account)
if (account) {
useHeadFixed({
title: () => `${t('account.following')} | ${getDisplayName(account)} (@${account.acct})`,
@ -17,6 +19,6 @@ if (account) {
<template>
<template v-if="paginator">
<AccountPaginator :paginator="paginator" />
<AccountPaginator :paginator="paginator" :relationship-context="isSelf ? 'following' : undefined" />
</template>
</template>