feat: hide profile when blocked
This commit is contained in:
parent
1476438d73
commit
f33b6b58cd
@ -1,6 +1,7 @@
|
||||
{
|
||||
"account": {
|
||||
"avatar_description": "{0}'s avatar",
|
||||
"blocked_by": "You're blocked by this user.",
|
||||
"blocked_domains": "Blocked domains",
|
||||
"blocked_users": "Blocked users",
|
||||
"favourites": "Favourites",
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"account": {
|
||||
"avatar_description": "{0}的头像",
|
||||
"blocked_by": "您已被此用户拉黑",
|
||||
"blocked_domains": "已拉黑的域名",
|
||||
"blocked_users": "已拉黑的用户",
|
||||
"favourites": "喜欢的帖文",
|
||||
|
@ -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>
|
||||
|
@ -43,10 +43,6 @@ const paginator = $computed(() => tabs.find(t => t.name === tab)!.paginator)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- TODO figure out when profile is unavailable -->
|
||||
<!-- <div v-if="(account!.discoverable === false)" h-30 flex="~ center" text-secondary-light>
|
||||
{{ $t('account.profile_unavailable') }}
|
||||
</div> -->
|
||||
<div>
|
||||
<CommonTabs v-model="tab" :options="tabs" command />
|
||||
<KeepAlive>
|
||||
|
Loading…
Reference in New Issue
Block a user