Reactions: Fix adding new custom reaction (#5111)

This commit is contained in:
zubiden 2024-10-26 13:02:06 +04:00 committed by Alexander Zinchuk
parent d51404cf8d
commit e614d816f8
2 changed files with 4 additions and 5 deletions

View File

@ -7,7 +7,6 @@ import type {
ApiMessage, ApiMessage,
ApiMessageEntity, ApiMessageEntity,
ApiReaction, ApiReaction,
ApiReactionCustomEmoji,
ApiReactionWithPaid, ApiReactionWithPaid,
ApiSticker, ApiSticker,
ApiStory, ApiStory,
@ -119,9 +118,9 @@ const ReactionPicker: FC<OwnProps & StateProps> = ({
if (!renderedChatId || !renderedMessageId) { if (!renderedChatId || !renderedMessageId) {
return; return;
} }
const reaction = sticker.isCustomEmoji const reaction: ApiReaction = sticker.isCustomEmoji
? { documentId: sticker.id } as ApiReactionCustomEmoji ? { type: 'custom', documentId: sticker.id }
: { emoticon: sticker.emoji } as ApiReaction; : { type: 'emoji', emoticon: sticker.emoji! };
toggleReaction({ toggleReaction({
chatId: renderedChatId, messageId: renderedMessageId, reaction, shouldAddToRecent: true, chatId: renderedChatId, messageId: renderedMessageId, reaction, shouldAddToRecent: true,

View File

@ -116,7 +116,7 @@ const Reactions: FC<OwnProps> = ({
return; return;
} }
updateMiddleSearch({ chatId: message.chatId, threadId, update: { savedTag: reaction as ApiReaction } }); updateMiddleSearch({ chatId: message.chatId, threadId, update: { savedTag: reaction } });
performMiddleSearch({ chatId: message.chatId, threadId }); performMiddleSearch({ chatId: message.chatId, threadId });
return; return;
} }