diff --git a/boot.php b/boot.php index 2dade9768..5d2659707 100644 --- a/boot.php +++ b/boot.php @@ -70,7 +70,7 @@ require_once('include/security.php'); define('PLATFORM_NAME', 'hubzilla'); -define('STD_VERSION', '10.5.2'); +define('STD_VERSION', '10.5.3'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); diff --git a/view/js/main.js b/view/js/main.js index dc2e87513..921e4f198 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -971,6 +971,7 @@ function imagesLoaded(elements, callback) { let loadedCount = 0; let totalImages = 0; let timeoutId; + let timedOut = false; const timeout = 10000; const processed = new Set(); // Use a Set for efficient lookup @@ -982,6 +983,10 @@ function imagesLoaded(elements, callback) { } function checkComplete(src) { + // If preloading timed out make sure to not call the callback again + // in case a load event listener fires later. + if (timedOut) return; + // Skip processing if image has already been processed if (processed.has(src)) return; @@ -1029,7 +1034,9 @@ function imagesLoaded(elements, callback) { // Set timeout for the loading process timeoutId = setTimeout(() => { console.warn(`Image loading timed out after ${timeout}ms`); + document.getElementById('image_counter').innerText = ''; callback(false); + timedOut = true; }, timeout); // Iterate through images to add load and error event listeners