ip
This commit is contained in:
+4
-2
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user