feat: always show account server (#119)

This commit is contained in:
三咲智子 Kevin Deng 2022-11-26 16:33:32 +08:00 committed by GitHub
parent de468fb28b
commit 1194d56d09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 10 deletions

View file

@ -35,6 +35,10 @@ export const STATUS_VISIBILITIES = [
},
] as const
export function getServerName(account: Account) {
return account.url.match(UserLinkRE)?.[1] || currentUser.value?.server || ''
}
export function getDisplayName(account: Account) {
return account.displayName || account.username
}
@ -47,7 +51,7 @@ export function getFullHandle(account: Account) {
const handle = `@${account.acct}`
if (!currentUser.value || account.acct.includes('@'))
return handle
return `${handle}@${account.url.match(UserLinkRE)?.[1] || currentUser.value.server}`
return `${handle}@${getServerName(account)}`
}
export function toShortHandle(fullHandle: string) {