Allow searching the emoji picker using other emoji

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-06-05 23:19:00 +01:00
parent ee3d2c51d8
commit 69ea635398
3 changed files with 12 additions and 12 deletions

View file

@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// @ts-ignore - import * as EMOJIBASE actually breaks this
import EMOJIBASE from 'emojibase-data/en/compact.json';
export interface IEmoji {
@ -70,7 +69,8 @@ EMOJIBASE.forEach((emoji: IEmojiWithFilterString) => {
DATA_BY_CATEGORY[categoryId].push(emoji);
}
// This is used as the string to match the query against when filtering emojis
emoji.filterString = `${emoji.annotation}\n${emoji.shortcodes.join('\n')}}\n${emoji.emoticon || ''}`.toLowerCase();
emoji.filterString = `${emoji.annotation}\n${emoji.shortcodes.join('\n')}}\n${emoji.emoticon || ''}\n` +
`${emoji.unicode.split("\u200D").join("\n")}`.toLowerCase();
// Add mapping from unicode to Emoji object
// The 'unicode' field that we use in emojibase has either