mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-05 00:19:59 +00:00
fix: get server name from acct
This commit is contained in:
parent
218aefeec1
commit
7760d03f9d
1 changed files with 6 additions and 4 deletions
|
@ -28,10 +28,6 @@ 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, options?: { rich?: boolean }) {
|
||||
const displayName = account?.displayName || account?.username || ''
|
||||
if (options?.rich)
|
||||
|
@ -45,6 +41,12 @@ export function getShortHandle({ acct }: Account) {
|
|||
return `@${acct.includes('@') ? acct.split('@')[0] : acct}`
|
||||
}
|
||||
|
||||
export function getServerName(account: Account) {
|
||||
if (account.acct.includes('@'))
|
||||
return account.acct.split('@')[1]
|
||||
return account.url.match(UserLinkRE)?.[1] || currentUser.value?.server || ''
|
||||
}
|
||||
|
||||
export function getFullHandle(account: Account) {
|
||||
const handle = `@${account.acct}`
|
||||
if (!currentUser.value || account.acct.includes('@'))
|
||||
|
|
Loading…
Reference in a new issue