fix: use full account handle, clean up

zio/stable
patak 2022-11-26 17:42:53 +01:00
parent bced99e14b
commit d4300d8d83
5 changed files with 5 additions and 12 deletions

View File

@ -10,15 +10,15 @@ defineProps<{
<div bg-base border="~ base" rounded w-80 z-900 overflow-hidden p-4 class="account-hover-card"> <div bg-base border="~ base" rounded w-80 z-900 overflow-hidden p-4 class="account-hover-card">
<AccountInfo :account="account" /> <AccountInfo :account="account" />
<div text-sm flex flex-row text-gray mt-4> <div text-sm flex flex-row text-gray mt-4>
<NuxtLink :to="`/${getShortHandle(account)}/`"> <NuxtLink :to="`/${getFullHandle(account)}/`">
{{ formattedNumber(account.statusesCount) }} Posts {{ formattedNumber(account.statusesCount) }} Posts
</NuxtLink> </NuxtLink>
<span flex-1 text-center> </span> <span flex-1 text-center> </span>
<NuxtLink :to="`/${getShortHandle(account)}/following`"> <NuxtLink :to="`/${getFullHandle(account)}/following`">
{{ humanReadableNumber(account.followingCount) }} Following {{ humanReadableNumber(account.followingCount) }} Following
</NuxtLink> </NuxtLink>
<span flex-1 text-center> </span> <span flex-1 text-center> </span>
<NuxtLink :to="`/${getShortHandle(account)}/followers`"> <NuxtLink :to="`/${getFullHandle(account)}/followers`">
{{ humanReadableNumber(account.followersCount) }} Followers {{ humanReadableNumber(account.followersCount) }} Followers
</NuxtLink> </NuxtLink>
</div> </div>

View File

@ -7,8 +7,6 @@ const { account, link = true, fullServer = false } = defineProps<{
fullServer?: boolean fullServer?: boolean
hover?: boolean hover?: boolean
}>() }>()
const accountHandle = $(useAccountHandle(account, fullServer))
</script> </script>
<template> <template>

View File

@ -5,8 +5,6 @@ const { account, link = true } = defineProps<{
account: Account account: Account
link?: boolean link?: boolean
}>() }>()
const accountHandle = $(useAccountHandle(account))
</script> </script>
<template> <template>
@ -15,8 +13,6 @@ const accountHandle = $(useAccountHandle(account))
flex="~ col" min-w-0 md:flex="~ row gap-2" md:items-center flex="~ col" min-w-0 md:flex="~ row gap-2" md:items-center
> >
<ContentRich font-bold break-words hover:underline :content="getDisplayName(account, { rich: true })" :emojis="account.emojis" /> <ContentRich font-bold break-words hover:underline :content="getDisplayName(account, { rich: true })" :emojis="account.emojis" />
<p op35 text-sm> <AccountHandle :account="account" op50 />
{{ accountHandle }}
</p>
</NuxtLink> </NuxtLink>
</template> </template>

View File

@ -41,7 +41,7 @@ const sorted = computed(() => {
@click="signout" @click="signout"
> >
<div i-ri:logout-box-line /> <div i-ri:logout-box-line />
Sign out {{ getShortHandle(currentUser.account) }} Sign out {{ getFullHandle(currentUser.account) }}
</button> </button>
</div> </div>
</div> </div>

View File

@ -48,7 +48,6 @@ export function getDisplayName(account?: Account, options?: { rich?: boolean })
} }
export function getShortHandle({ acct }: Account) { export function getShortHandle({ acct }: Account) {
return `@${acct.includes('@') ? acct.split('@')[0] : acct}` return `@${acct.includes('@') ? acct.split('@')[0] : acct}`
} }