From 0a6900fc770c07b77348a2919c60043e8bfd38ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 16 Aug 2022 19:17:23 -0400 Subject: [PATCH] feat: don't show signatures again in pagination mode in same topic --- public/src/client/topic.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/src/client/topic.js b/public/src/client/topic.js index 691e3a5543..3fd79ddce5 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -20,6 +20,7 @@ define('forum/topic', [ components, storage, hooks, api, alerts ) { const Topic = {}; + let tid = 0; let currentUrl = ''; $(window).on('action:ajaxify.start', function (ev, data) { @@ -33,14 +34,18 @@ define('forum/topic', [ }); Topic.init = function () { - const tid = ajaxify.data.tid; + const tidChanged = !tid || parseInt(tid, 10) !== parseInt(ajaxify.data.tid, 10); + tid = ajaxify.data.tid; currentUrl = ajaxify.currentPage; hooks.fire('action:topic.loading'); app.enterRoom('topic_' + tid); + if (tidChanged) { + console.log('tid changed clearing'); + posts.signaturesShown = {}; + } posts.onTopicPageLoad(components.get('post')); - posts.signaturesShown = {}; navigator.init('[component="post"]', ajaxify.data.postcount, Topic.toTop, Topic.toBottom, utils.debounce(Topic.navigatorCallback, 500)); postTools.init(tid);