Skip to content

Commit

Permalink
Don’t overwrite custom category emojis array [Fix #679, Fix #682, Fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneLem committed Sep 5, 2022
1 parent dc8888d commit 529f999
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/emoji-mart/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,9 @@ async function _init(props) {

Data.categories.push(category)

const ids = []
for (const emoji of category.emojis) {
if (ids.indexOf(emoji.id) > -1) {
continue
}

Data.emojis[emoji.id] = emoji
ids.push(emoji.id)
}

category.emojis = ids
}
}

Expand Down Expand Up @@ -158,7 +150,9 @@ async function _init(props) {

let emojiIndex = category.emojis.length
while (emojiIndex--) {
const emoji = Data.emojis[category.emojis[emojiIndex]]
const emojiId = category.emojis[emojiIndex]
const emoji = emojiId.id ? emojiId : Data.emojis[emojiId]

const ignore = () => {
category.emojis.splice(emojiIndex, 1)
}
Expand Down

0 comments on commit 529f999

Please sign in to comment.