feat: hide profile when blocked

This commit is contained in:
三咲智子 2022-12-05 00:50:38 +08:00
parent 1476438d73
commit f33b6b58cd
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
4 changed files with 13 additions and 5 deletions

View file

@ -5,6 +5,7 @@ const accountName = $(computedEager(() => toShortHandle(params.account as string
const { t } = useI18n()
const { data: account, refresh } = $(await useAsyncData(() => fetchAccountByHandle(accountName).catch(() => null)))
const relationship = $computed(() => account ? useRelationship(account).value : undefined)
if (account) {
useHeadFixed({
@ -27,7 +28,16 @@ onReactivated(() => {
<template v-if="account">
<AccountHeader :account="account" command border="b base" />
<NuxtPage />
<div v-if="relationship?.blockedBy" h-30 flex="~ col center gap-2">
<div text-secondary>
{{ $t('account.profile_unavailable') }}
</div>
<div text-secondary-light text-sm>
{{ $t('account.blocked_by') }}
</div>
</div>
<NuxtPage v-else />
</template>
<CommonNotFound v-else>