emoji-picker-react 4.5.10 → 4.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.5.10",
2
+ "version": "4.5.12",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -93,18 +93,21 @@ export function emojiByUnified(unified?: string): DataEmoji | undefined {
93
93
  export const allEmojis: DataEmojis = Object.values(emojis).flat();
94
94
 
95
95
  export function setCustomEmojis(customEmojis: CustomEmoji[]): void {
96
- emojis[Categories.CUSTOM] = [];
96
+ if (!customEmojis || customEmojis.length === 0) {
97
+ emojis[Categories.CUSTOM].length = 0;
98
+ }
97
99
 
98
100
  customEmojis.forEach(emoji => {
99
101
  const emojiData = customToRegularEmoji(emoji);
100
102
 
103
+ emojis[Categories.CUSTOM].push(emojiData as never);
104
+
101
105
  if (allEmojisByUnified[emojiData[EmojiProperties.unified]]) {
102
106
  return;
103
107
  }
104
108
 
105
109
  allEmojis.push(emojiData);
106
110
  allEmojisByUnified[emojiData[EmojiProperties.unified]] = emojiData;
107
- emojis[Categories.CUSTOM].push(emojiData as never);
108
111
  indexEmoji(emojiData);
109
112
  });
110
113
  }