Feature filter invalid emojisrelease
commit
35c05eb62d
|
@ -2,6 +2,7 @@ import React from 'react'
|
|||
import PropTypes from 'prop-types'
|
||||
|
||||
import frequently from '../utils/frequently'
|
||||
import { getData } from '../utils'
|
||||
import { Emoji } from '.'
|
||||
|
||||
export default class Category extends React.Component {
|
||||
|
@ -107,7 +108,11 @@ export default class Category extends React.Component {
|
|||
}
|
||||
|
||||
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)) {
|
||||
emojiData = data.emojis[emoji]
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
} else if (emoji.id) {
|
||||
if (data.short_names.hasOwnProperty(emoji.id)) {
|
||||
|
|
Loading…
Reference in New Issue