pinafore/routes/_a11y/getAccountAccessibleName.js
Nolan Lawson cc81a7bec6
fix(a11y): improved aria-label for status and notifications (#690)
* fix(a11y): improved aria-label for status and notifications

fixes #689

* only calculate formatted date once

* fixup tests

*  fixup tests more

* fixup

* fixup tests again
2018-11-25 01:20:58 -08:00

11 lines
348 B
JavaScript

import { removeEmoji } from '../_utils/removeEmoji'
export function getAccountAccessibleName (account, omitEmojiInDisplayNames) {
let emojis = account.emojis
let displayName = account.display_name || account.username
if (omitEmojiInDisplayNames) {
displayName = removeEmoji(displayName, emojis) || displayName
}
return displayName
}