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,
ApiMessageEntity,
ApiReaction,
ApiReactionCustomEmoji,
ApiReactionWithPaid,
ApiSticker,
ApiStory,
@ -119,9 +118,9 @@ const ReactionPicker: FC<OwnProps & StateProps> = ({
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,

View File

@ -116,7 +116,7 @@ const Reactions: FC<OwnProps> = ({
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;
}