feat: adjust hide username emojis pref to only hide in timeline (#1631)

This commit is contained in:
Tuur Martens 2023-02-05 14:00:25 +01:00 committed by GitHub
parent 7dfe91bb9d
commit a1b2da3d5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 28 additions and 20 deletions

View file

@ -30,8 +30,8 @@ export function contentToVNode(
const textContents = getTexualAstComponents(tree.children)
// if the username only contains emojis, we should probably show the emojis anyway to avoid a blank name
if (!options?.showEmojis && textContents.length === 0)
tree = parseMastodonHTML(content, { ...options, showEmojis: true })
if (options?.hideEmojis && textContents.length === 0)
tree = parseMastodonHTML(content, { ...options, hideEmojis: false })
return h(Fragment, (tree.children as Node[] || []).map(n => treeToVNode(n)))
}