diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index e3f4297..b0864f4 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -3715,6 +3715,18 @@ window.cancelAnimFrame = (function () { targetUrl = targetUrl.replace(/[?&]strict=1/, '').replace(/[?&]$/, ''); } + // If we're already on this exact page and there's no cached grid to restore, + // just scroll to top — no point wiping and re-fetching the current grid. + const _targetBase = targetUrl.split('#')[0]; + const _currentBase = window.location.href.split('#')[0]; + if (_targetBase === _currentBase && !anyLink.hash) { + const _cacheKey = new URL(targetUrl, window.location.origin).pathname + new URL(targetUrl, window.location.origin).search; + if (!gridCacheMap.has(_cacheKey)) { + window.scrollTo({ top: 0, behavior: 'smooth' }); + return false; + } + } + const parts = pathname.split('/').filter(Boolean); const isItemLink = !pathname.match(/\/p\//) && ( pathname.match(/^\/\d+/) ||