From 1a37fd0ca463d00d70273ca2b2f32bc7b4d936de Mon Sep 17 00:00:00 2001 From: greentore <117551249+greentore@users.noreply.github.com> Date: Sun, 23 Jul 2023 10:11:36 +0200 Subject: [PATCH] Use sticker body for searching (#1347) --- src/app/components/emoji-board/EmojiBoard.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/components/emoji-board/EmojiBoard.tsx b/src/app/components/emoji-board/EmojiBoard.tsx index 4005234..76c6f05 100644 --- a/src/app/components/emoji-board/EmojiBoard.tsx +++ b/src/app/components/emoji-board/EmojiBoard.tsx @@ -598,7 +598,13 @@ export const NativeEmojiGroups = memo( ) ); -const getSearchListItemStr = (item: ExtendedPackImage | IEmoji) => `:${item.shortcode}:`; +const getSearchListItemStr = (item: ExtendedPackImage | IEmoji) => { + const shortcode = `:${item.shortcode}:`; + if ('body' in item) { + return [shortcode, item.body ?? '']; + } + return shortcode; +}; const SEARCH_OPTIONS: UseAsyncSearchOptions = { limit: 26, matchOptions: {