From 06a4e0c93be98244989aac08fcbf7806e448d239 Mon Sep 17 00:00:00 2001 From: ginnyTheCat Date: Wed, 29 Jun 2022 14:49:43 +0200 Subject: [PATCH] Add emoji name fallback (#658) --- src/app/organisms/emoji-board/emoji.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/organisms/emoji-board/emoji.js b/src/app/organisms/emoji-board/emoji.js index 4f76f7c..3cbd0b8 100644 --- a/src/app/organisms/emoji-board/emoji.js +++ b/src/app/organisms/emoji-board/emoji.js @@ -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,