bugfix: don't error if emoji not found
ci/woodpecker/tag/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
FloatingGhost 2022-06-20 14:55:38 +01:00
parent 15ec862da0
commit ca8689fc88
1 changed files with 15 additions and 10 deletions

View File

@ -234,16 +234,21 @@ export default defineComponent({
}
case 'emojiCode': {
return [h('div', {
class: 'still-image emoji img'
},
[h('img', {
key: Math.random(),
title: token.props.name,
alt: token.props.name,
src: this.status.emojis.find((emoji) => emoji.shortcode === token.props.name).static_url
})]
)]
const emoj = this.status.emojis.find((emoji) => emoji.shortcode === token.props.name)
if (emoj) {
return [h('div', {
class: 'still-image emoji img'
},
[h('img', {
key: Math.random(),
title: token.props.name,
alt: token.props.name,
src: this.status.emojis.find((emoji) => emoji.shortcode === token.props.name).static_url
})]
)]
} else {
return `:${token.props.name}:`
}
}
case 'unicodeEmoji': {