fix: get server name from acct
parent
218aefeec1
commit
7760d03f9d
|
@ -28,10 +28,6 @@ export const STATUS_VISIBILITIES = [
|
||||||
},
|
},
|
||||||
] as const
|
] as const
|
||||||
|
|
||||||
export function getServerName(account: Account) {
|
|
||||||
return account.url.match(UserLinkRE)?.[1] || currentUser.value?.server || ''
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getDisplayName(account?: Account, options?: { rich?: boolean }) {
|
export function getDisplayName(account?: Account, options?: { rich?: boolean }) {
|
||||||
const displayName = account?.displayName || account?.username || ''
|
const displayName = account?.displayName || account?.username || ''
|
||||||
if (options?.rich)
|
if (options?.rich)
|
||||||
|
@ -45,6 +41,12 @@ export function getShortHandle({ acct }: Account) {
|
||||||
return `@${acct.includes('@') ? acct.split('@')[0] : acct}`
|
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) {
|
export function getFullHandle(account: Account) {
|
||||||
const handle = `@${account.acct}`
|
const handle = `@${account.acct}`
|
||||||
if (!currentUser.value || account.acct.includes('@'))
|
if (!currentUser.value || account.acct.includes('@'))
|
||||||
|
|
Loading…
Reference in New Issue