Handle unknown emojis [Fix #14]
parent
ac4feba228
commit
8f64b3c7d1
|
@ -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)}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue