This commit is contained in:
Lizandro Guarnizo
2026-01-25 21:08:09 -05:00
parent efd711b1dc
commit eca0c919a4
3 changed files with 69 additions and 4 deletions
+4 -2
View File
@@ -1247,10 +1247,12 @@
const resp = await fetch('api/react_message.php', { method: 'POST', headers: {'Content-Type':'application/json'}, body: JSON.stringify({ message_id: mid, emoji: emoji }) });
const j = await resp.json();
if (j && j.success) {
// Prefer the server-side normalized emoji when available (handles alias -> emoji mapping)
const serverEmoji = (j.updated && j.updated.reaction_emoji) ? j.updated.reaction_emoji : emoji;
// update local model and UI
const m = this.conversations.find(x => x.message_id == mid || x.id == mid);
if (m) m.reaction_emoji = emoji;
this.updateMessageReactionInView && this.updateMessageReactionInView(mid, emoji);
if (m) m.reaction_emoji = serverEmoji;
this.updateMessageReactionInView && this.updateMessageReactionInView(mid, serverEmoji);
} else {
showAlert && showAlert('Error aplicando reacción', 'danger');
}