Group emojis only by pack and remove pack: prefix
Ref: grouped-emoji-picker
This commit is contained in:
parent
3156f046b4
commit
d648a6f8dc
@ -116,9 +116,15 @@ const instance = {
|
|||||||
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})
|
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})
|
||||||
},
|
},
|
||||||
groupedCustomEmojis (state) {
|
groupedCustomEmojis (state) {
|
||||||
|
const packsOf = emoji => {
|
||||||
|
return emoji.tags
|
||||||
|
.filter(k => k.startsWith('pack:'))
|
||||||
|
.map(k => k.slice(5)) // remove 'pack:' prefix
|
||||||
|
}
|
||||||
|
|
||||||
return state.customEmoji
|
return state.customEmoji
|
||||||
.reduce((res, emoji) => {
|
.reduce((res, emoji) => {
|
||||||
emoji.tags.forEach(packName => {
|
packsOf(emoji).forEach(packName => {
|
||||||
const packId = `custom-${packName}`
|
const packId = `custom-${packName}`
|
||||||
if (!res[packId]) {
|
if (!res[packId]) {
|
||||||
res[packId] = ({
|
res[packId] = ({
|
||||||
|
Loading…
Reference in New Issue
Block a user