2022-11-13 19:05:32 +03:00
|
|
|
<script setup lang="ts">
|
|
|
|
const params = useRoute().params
|
2022-11-27 20:34:45 +03:00
|
|
|
const accountName = $(computedEager(() => toShortHandle(params.account as string)))
|
2022-11-21 00:38:52 +03:00
|
|
|
|
2022-11-28 17:25:32 +03:00
|
|
|
const { t } = useI18n()
|
|
|
|
|
2022-11-30 10:11:26 +03:00
|
|
|
const { data: account, refresh } = $(await useAsyncData(() => fetchAccountByHandle(accountName).catch(() => null)))
|
2022-11-21 00:38:52 +03:00
|
|
|
|
2022-11-26 02:49:56 +03:00
|
|
|
if (account) {
|
2022-11-30 01:49:25 +03:00
|
|
|
useHeadFixed({
|
2022-11-26 18:06:30 +03:00
|
|
|
title: () => `${getDisplayName(account)} (@${account.acct})`,
|
2022-11-26 02:49:56 +03:00
|
|
|
})
|
|
|
|
}
|
2022-11-27 20:34:45 +03:00
|
|
|
|
|
|
|
onReactivated(() => {
|
|
|
|
// Silently update data when reentering the page
|
|
|
|
// The user will see the previous content first, and any changes will be updated to the UI when the request is completed
|
|
|
|
refresh()
|
|
|
|
})
|
2022-11-13 19:05:32 +03:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-11-26 15:58:10 +03:00
|
|
|
<MainContent back>
|
|
|
|
<template #title>
|
2022-11-28 17:25:32 +03:00
|
|
|
<span text-lg font-bold>{{ account ? getDisplayName(account) : t('nav_side.profile') }}</span>
|
2022-11-26 15:58:10 +03:00
|
|
|
</template>
|
|
|
|
|
2022-11-26 02:49:56 +03:00
|
|
|
<template v-if="account">
|
2022-11-29 11:15:05 +03:00
|
|
|
<AccountHeader :account="account" command border="b base" />
|
2022-11-26 02:49:56 +03:00
|
|
|
<NuxtPage />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<CommonNotFound v-else>
|
2022-11-30 00:50:13 +03:00
|
|
|
{{ $t('error.account_not_found', [`@${accountName}`]) }}
|
2022-11-26 02:49:56 +03:00
|
|
|
</CommonNotFound>
|
|
|
|
</MainContent>
|
2022-11-13 19:05:32 +03:00
|
|
|
</template>
|