fix: publish widget mentions (#1198)

This commit is contained in:
patak 2023-01-16 06:10:33 +01:00 committed by GitHub
parent d24c1da35e
commit bb2e3ab44f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View file

@ -7,10 +7,14 @@ export function getDisplayName(account: mastodon.v1.Account, options?: { rich?:
return displayName.replace(/:([\w-]+?):/g, '')
}
export function acctToShortHandle(acct: string) {
return `@${acct.includes('@') ? acct.split('@')[0] : acct}`
}
export function getShortHandle({ acct }: mastodon.v1.Account) {
if (!acct)
return ''
return `@${acct.includes('@') ? acct.split('@')[0] : acct}`
return acctToShortHandle(acct)
}
export function getServerName(account: mastodon.v1.Account) {