diff --git a/src/components/middle/message/reactions/ReactionPicker.tsx b/src/components/middle/message/reactions/ReactionPicker.tsx index b84fd44fc..152630aae 100644 --- a/src/components/middle/message/reactions/ReactionPicker.tsx +++ b/src/components/middle/message/reactions/ReactionPicker.tsx @@ -7,7 +7,6 @@ import type { ApiMessage, ApiMessageEntity, ApiReaction, - ApiReactionCustomEmoji, ApiReactionWithPaid, ApiSticker, ApiStory, @@ -119,9 +118,9 @@ const ReactionPicker: FC = ({ if (!renderedChatId || !renderedMessageId) { return; } - const reaction = sticker.isCustomEmoji - ? { documentId: sticker.id } as ApiReactionCustomEmoji - : { emoticon: sticker.emoji } as ApiReaction; + const reaction: ApiReaction = sticker.isCustomEmoji + ? { type: 'custom', documentId: sticker.id } + : { type: 'emoji', emoticon: sticker.emoji! }; toggleReaction({ chatId: renderedChatId, messageId: renderedMessageId, reaction, shouldAddToRecent: true, diff --git a/src/components/middle/message/reactions/Reactions.tsx b/src/components/middle/message/reactions/Reactions.tsx index f1285f3a4..716124042 100644 --- a/src/components/middle/message/reactions/Reactions.tsx +++ b/src/components/middle/message/reactions/Reactions.tsx @@ -116,7 +116,7 @@ const Reactions: FC = ({ return; } - updateMiddleSearch({ chatId: message.chatId, threadId, update: { savedTag: reaction as ApiReaction } }); + updateMiddleSearch({ chatId: message.chatId, threadId, update: { savedTag: reaction } }); performMiddleSearch({ chatId: message.chatId, threadId }); return; }