Fix previews in actions ("/me") after page reload

This commit is contained in:
Jérémie Astori 2017-07-18 01:27:18 -04:00
parent ce0e460368
commit 5fb34ce93f
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8

View File

@ -73,16 +73,14 @@ function buildChatMessage(data) {
const msg = $(templates[template](data.msg)); const msg = $(templates[template](data.msg));
const text = msg.find(".text"); const text = msg.find(".text");
if (data.msg.previews.length) {
data.msg.previews.forEach((preview) => {
renderPreview(preview, msg);
});
}
if (template === "msg_action") { if (template === "msg_action") {
text.html(templates.actions[type](data.msg)); text.html(templates.actions[type](data.msg));
} }
data.msg.previews.forEach((preview) => {
renderPreview(preview, msg);
});
if ((type === "message" || type === "action") && chan.hasClass("channel")) { if ((type === "message" || type === "action") && chan.hasClass("channel")) {
const nicks = chan.find(".users").data("nicks"); const nicks = chan.find(".users").data("nicks");
if (nicks) { if (nicks) {