Skip to content

Commit 4a6ee47

Browse files
authored
Merge pull request #787 from GetStream/fix-emoji-transform
Fix unexpected undefined in autocomplete
2 parents b208766 + 3f5158e commit 4a6ee47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/ChatAutoComplete/ChatAutoComplete.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ const ChatAutoComplete = (props) => {
3131
const emojiReplace = (word) => {
3232
const found = emojiIndex?.search(word) || [];
3333
const emoji = found.slice(0, 10).find(
34-
/** @type {{ ({ emoticons } : import('emoji-mart').EmojiData): boolean }} */
35-
({ emoticons }) => !!emoticons?.includes(word),
34+
/** @type {{ ({ emoticons } : import('emoji-mart').EmojiData): boolean }} | undefined */
35+
(match) => !!match?.emoticons?.includes(word),
3636
);
3737
if (!emoji || !('native' in emoji)) return null;
3838
return emoji.native;

0 commit comments

Comments
 (0)