Filter invalid emojis from recent category
parent
e4ec409fc7
commit
8df1c418d3
|
@ -2,6 +2,7 @@ import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
import frequently from '../utils/frequently'
|
import frequently from '../utils/frequently'
|
||||||
|
import { getData } from '../utils'
|
||||||
import { Emoji } from '.'
|
import { Emoji } from '.'
|
||||||
|
|
||||||
export default class Category extends React.Component {
|
export default class Category extends React.Component {
|
||||||
|
@ -107,7 +108,11 @@ export default class Category extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
return id
|
return id
|
||||||
})
|
}).filter(id => !!getData(id))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (emojis.length === 0 && frequentlyUsed.length > 0) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,8 @@ function getData(emoji, skin, set) {
|
||||||
|
|
||||||
if (data.emojis.hasOwnProperty(emoji)) {
|
if (data.emojis.hasOwnProperty(emoji)) {
|
||||||
emojiData = data.emojis[emoji]
|
emojiData = data.emojis[emoji]
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
} else if (emoji.id) {
|
} else if (emoji.id) {
|
||||||
if (data.short_names.hasOwnProperty(emoji.id)) {
|
if (data.short_names.hasOwnProperty(emoji.id)) {
|
||||||
|
|
Loading…
Reference in New Issue