From b4951b1f86823792ae44e3880d8ee5c5ce851f3b Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Thu, 1 Feb 2018 09:57:15 +0200 Subject: [PATCH] Fix auto-open media option not working Bug introduced in ffa9685b41870ef1340a0d8ac348b2e352feed87 --- client/js/renderPreview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/js/renderPreview.js b/client/js/renderPreview.js index fdbd0b14..98d2f9ac 100644 --- a/client/js/renderPreview.js +++ b/client/js/renderPreview.js @@ -15,6 +15,8 @@ function renderPreview(preview, msg) { return; } + preview.shown = preview.shown && options.shouldOpenMessagePreview(preview.type); + const template = $(templates.msg_preview({preview: preview})); const image = template.find("img:first"); @@ -40,8 +42,6 @@ function appendPreview(preview, msg, template) { return; } - preview.shown = preview.shown && options.shouldOpenMessagePreview(preview.type); - const container = msg.closest(".messages"); const channelId = container.closest(".chan").data("id") || -1; const activeChannelId = chat.find(".chan.active").data("id") || -2;