Handle unknown emojis [Fix #14]

release
Etienne Lemay 2016-10-12 20:26:10 -04:00
parent ac4feba228
commit 8f64b3c7d1
2 changed files with 15 additions and 5 deletions

View File

@ -59,7 +59,12 @@ export default class Emoji extends React.Component {
}
render() {
var { sheetURL, size, onOver, onLeave } = this.props
var { sheetURL, size, onOver, onLeave } = this.props,
{ unified } = this.getData()
if (!unified) {
return null
}
return <span
onClick={this.handleClick.bind(this)}

View File

@ -36,13 +36,18 @@ function getSanitizedData() {
}
function getData(emoji, skin, sheetURL) {
var emojiData = {}
var emojiData = {},
_emojiData = null
if (typeof emoji == 'string') {
emojiData = data.emojis[emoji]
if (_emojiData = data.emojis[emoji]) {
emojiData = _emojiData
}
} else if (emoji.id) {
emojiData = data.emojis[emoji.id]
skin || (skin = emoji.skin)
if (_emojiData = data.emojis[emoji.id]) {
emojiData = _emojiData
skin || (skin = emoji.skin)
}
}
if (emojiData.skin_variations && skin > 1 && sheetURL) {