allow editing pinned chat messages

only update message body and edited component
This commit is contained in:
Barış Soner Uşaklı
2023-09-12 12:16:09 -04:00
parent e56390816f
commit e2777f4a4e

View File

@@ -273,7 +273,13 @@ define('forum/chats/messages', [
messages.parseMessage(message, function (html) {
const msgEl = components.get('chat/message', message.mid);
if (msgEl.length) {
msgEl.replaceWith(html);
const componentsToReplace = [
'[component="chat/message/body"]',
'[component="chat/message/edited"]',
];
componentsToReplace.forEach((cmp) => {
msgEl.find(cmp).replaceWith(html.find(cmp));
});
messages.onMessagesAddedToDom(components.get('chat/message', message.mid));
}
const parentEl = $(`[component="chat/message/parent"][data-parent-mid="${message.mid}"]`);