parent
c2850a34ae
commit
c1e89582f8
|
@ -20,7 +20,7 @@ const createdAt = useFormattedDateTime(status.createdAt)
|
|||
const { t } = useI18n()
|
||||
|
||||
useHeadFixed({
|
||||
title: () => `${status.account.displayName || status.account.acct} ${t('common.in')} ${t('app_name')}: "${removeHTMLTags(status.content) || ''}"`,
|
||||
title: () => `${getDisplayName(status.account)} ${t('common.in')} ${t('app_name')}: "${removeHTMLTags(status.content) || ''}"`,
|
||||
})
|
||||
|
||||
const isDM = $computed(() => status.visibility === 'direct')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { mastodon } from 'masto'
|
||||
|
||||
export function getDisplayName(account?: mastodon.v1.Account, options?: { rich?: boolean }) {
|
||||
const displayName = account?.displayName || account?.username || ''
|
||||
export function getDisplayName(account: mastodon.v1.Account, options?: { rich?: boolean }) {
|
||||
const displayName = account.displayName || account.username || account.acct || ''
|
||||
if (options?.rich)
|
||||
return displayName
|
||||
return displayName.replace(/:([\w-]+?):/g, '')
|
||||
|
|
Loading…
Reference in New Issue