Skip to content

Commit

Permalink
fix: Update emoji list in markdown editor for node-emoji 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
baumandm committed Jan 8, 2024
1 parent 007ac36 commit 0049d49
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { useBreakpointValue } from '@chakra-ui/media-query';
import { useColorModeValue } from '@chakra-ui/react';
import { nanoid } from 'nanoid';
import { emoji } from 'node-emoji';
import * as emoji from 'node-emoji';
import { useEffect, useRef, useState } from 'react';
import AceEditor from 'react-ace';
import { gql } from 'urql';
Expand Down Expand Up @@ -53,12 +53,12 @@ const emojiCompleter = {
}

if (emojiList === undefined) {
emojiList = Object.keys(emoji).map((key) => {
const shortcode = `:${key}:`;
emojiList = emoji.search('').map((results) => {
const shortcode = `:${results.name}:`;
return {
name: shortcode,
value: shortcode,
caption: `${emoji[key]} ${shortcode}`,
caption: `${results.emoji} ${shortcode}`,
meta: 'emoji',
score: 1000
};
Expand Down

0 comments on commit 0049d49

Please sign in to comment.