Revert "uga aga pipi kaka"

This reverts commit ecdf54a894.
This commit is contained in:
2026-07-12 20:22:19 +02:00
parent d4273ed515
commit 3856f752bd

View File

@@ -2227,15 +2227,12 @@ window.cancelAnimFrame = (function () {
} }
// Check for cached grid (Index/Grid Only) - RESTORE EARLY to avoid pagination/layout destruction. // Check for cached grid (Index/Grid Only) - RESTORE EARLY to avoid pagination/layout destruction
// We check the cache for ANY grid navigation (not just skipPush/popstate) so that clicking the if (isGrid && options.skipPush) {
// logo or any other link back to a previously-viewed grid page is instant — no blank thumbs,
// no re-fetch. The cached DOM node already has all background-images set on the thumb elements.
if (isGrid) {
const targetCacheKey = urlObj.pathname + urlObj.search; const targetCacheKey = urlObj.pathname + urlObj.search;
if (gridCacheMap.has(targetCacheKey)) { if (gridCacheMap.has(targetCacheKey)) {
const cache = gridCacheMap.get(targetCacheKey); const cache = gridCacheMap.get(targetCacheKey);
gridCacheMap.delete(targetCacheKey); // Consume cache (one-shot restore) gridCacheMap.delete(targetCacheKey); // Consume cache
stopMedia(); stopMedia();
@@ -2283,12 +2280,6 @@ window.cancelAnimFrame = (function () {
if (restoredPosts._infiniteState) restoredPosts._infiniteState.loading = false; if (restoredPosts._infiniteState) restoredPosts._infiniteState.loading = false;
} }
} }
// Push URL to history for forward navigations (logo click etc.) so the back button works.
// skipPush navigations (popstate) must NOT push or we'd create a double history entry.
if (!options.skipPush) {
history.pushState({}, '', url);
}
// Restore Scroll Position // Restore Scroll Position
requestAnimationFrame(() => window.scrollTo(0, cache.scroll)); requestAnimationFrame(() => window.scrollTo(0, cache.scroll));
@@ -3715,18 +3706,6 @@ window.cancelAnimFrame = (function () {
targetUrl = targetUrl.replace(/[?&]strict=1/, '').replace(/[?&]$/, ''); 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 parts = pathname.split('/').filter(Boolean);
const isItemLink = !pathname.match(/\/p\//) && ( const isItemLink = !pathname.match(/\/p\//) && (
pathname.match(/^\/\d+/) || pathname.match(/^\/\d+/) ||