feat: hide profile when blocked
parent
1476438d73
commit
f33b6b58cd
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"account": {
|
"account": {
|
||||||
"avatar_description": "{0}'s avatar",
|
"avatar_description": "{0}'s avatar",
|
||||||
|
"blocked_by": "You're blocked by this user.",
|
||||||
"blocked_domains": "Blocked domains",
|
"blocked_domains": "Blocked domains",
|
||||||
"blocked_users": "Blocked users",
|
"blocked_users": "Blocked users",
|
||||||
"favourites": "Favourites",
|
"favourites": "Favourites",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"account": {
|
"account": {
|
||||||
"avatar_description": "{0}的头像",
|
"avatar_description": "{0}的头像",
|
||||||
|
"blocked_by": "您已被此用户拉黑",
|
||||||
"blocked_domains": "已拉黑的域名",
|
"blocked_domains": "已拉黑的域名",
|
||||||
"blocked_users": "已拉黑的用户",
|
"blocked_users": "已拉黑的用户",
|
||||||
"favourites": "喜欢的帖文",
|
"favourites": "喜欢的帖文",
|
||||||
|
|
|
@ -5,6 +5,7 @@ const accountName = $(computedEager(() => toShortHandle(params.account as string
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const { data: account, refresh } = $(await useAsyncData(() => fetchAccountByHandle(accountName).catch(() => null)))
|
const { data: account, refresh } = $(await useAsyncData(() => fetchAccountByHandle(accountName).catch(() => null)))
|
||||||
|
const relationship = $computed(() => account ? useRelationship(account).value : undefined)
|
||||||
|
|
||||||
if (account) {
|
if (account) {
|
||||||
useHeadFixed({
|
useHeadFixed({
|
||||||
|
@ -27,7 +28,16 @@ onReactivated(() => {
|
||||||
|
|
||||||
<template v-if="account">
|
<template v-if="account">
|
||||||
<AccountHeader :account="account" command border="b base" />
|
<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>
|
</template>
|
||||||
|
|
||||||
<CommonNotFound v-else>
|
<CommonNotFound v-else>
|
||||||
|
|
|
@ -43,10 +43,6 @@ const paginator = $computed(() => tabs.find(t => t.name === tab)!.paginator)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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>
|
<div>
|
||||||
<CommonTabs v-model="tab" :options="tabs" command />
|
<CommonTabs v-model="tab" :options="tabs" command />
|
||||||
<KeepAlive>
|
<KeepAlive>
|
||||||
|
|
Loading…
Reference in New Issue