Fix Removed Reactions Events: Emit a Socket Event in "messages.reaction" (#1371)

* fix: emit event with empty reactions

* chore: fix lint

---------

Co-authored-by: Cassio Santos <cassio@economicros.com.br>
This commit is contained in:
Gustavo Quadri
2025-06-18 08:30:19 -03:00
committed by GitHub
parent e2ce275949
commit cf514fa8d7

View File

@@ -725,10 +725,8 @@ export const updateMessageWithReaction = (msg: Pick<WAMessage, 'reactions'>, rea
const authorID = getKeyAuthor(reaction.key)
const reactions = (msg.reactions || []).filter(r => getKeyAuthor(r.key) !== authorID)
if (reaction.text) {
reactions.push(reaction)
}
reaction.text = reaction.text || ''
reactions.push(reaction)
msg.reactions = reactions
}