Add emoji name fallback (#658)
authorginnyTheCat <ginnythecat@lelux.net>
Wed, 29 Jun 2022 12:49:43 +0000 (14:49 +0200)
committerGitHub <noreply@github.com>
Wed, 29 Jun 2022 12:49:43 +0000 (18:19 +0530)
src/app/organisms/emoji-board/emoji.js

index 4f76f7c64fb4fce1d8b51d4209022c0a14259615..3cbd0b8813d11600a5c14eaed26df1d04c733c4e 100644 (file)
@@ -1,5 +1,6 @@
 import emojisData from 'emojibase-data/en/compact.json';
-import shortcodes from 'emojibase-data/en/shortcodes/joypixels.json';
+import joypixels from 'emojibase-data/en/shortcodes/joypixels.json';
+import emojibase from 'emojibase-data/en/shortcodes/emojibase.json';
 
 const emojiGroups = [{
   name: 'Smileys & people',
@@ -52,7 +53,7 @@ function addToGroup(emoji) {
 
 const emojis = [];
 emojisData.forEach((emoji) => {
-  const myShortCodes = shortcodes[emoji.hexcode];
+  const myShortCodes = joypixels[emoji.hexcode] || emojibase[emoji.hexcode];
   if (!myShortCodes) return;
   const em = {
     ...emoji,