From a9f81215cfe41aa8da12d05e16171cc7a2858d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 21 Dec 2021 11:52:16 -0500 Subject: [PATCH] fix: only render preview on topic page --- public/src/client/topic.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/src/client/topic.js b/public/src/client/topic.js index f481b200ec..231377967e 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -190,7 +190,8 @@ define('forum/topic', [ async function renderPost(pid) { const postData = postCache[pid] || await socket.emit('posts.getPostSummaryByPid', { pid: pid }); - if (postData) { + $('#post-tooltip').remove(); + if (postData && ajaxify.data.template.topic) { postCache[pid] = postData; const tooltip = await app.parseAndTranslate('partials/topic/post-preview', { post: postData }); tooltip.hide().find('.timeago').timeago();