From 2802092a15ccca83892faf188bcd24891dd52e57 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Fri, 12 Jul 2024 18:16:27 +0100 Subject: [PATCH] Extend time between reloads for failed SW registration #1255 (#1272) --- www/js/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index ec1b1ac9f..0ab3ad532 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -991,10 +991,10 @@ function initServiceWorkerMessaging () { action: 'init' }); } else if (serviceWorkerRegistration) { - // If this is the first time we are initiating the SW, allow Promises to complete by delaying potential reload till next tick + // If this is the first time we are initiating the SW, allow Promises to complete and assets to be fetched by delaying potential reload console.warn('The Service Worker needs more time to load, or else the app was force-refreshed...'); serviceWorkerRegistration = null; - setTimeout(initServiceWorkerMessaging, 1600); + setTimeout(initServiceWorkerMessaging, 3000); } else if (params.contentInjectionMode === 'serviceworker') { console.error('The Service Worker is not controlling the current page! We have to reload.'); // Turn off failsafe, as this is a controlled reboot @@ -1010,7 +1010,7 @@ function initServiceWorkerMessaging () { setTimeout(function () { params.themeChanged = true; document.getElementById('btnHome').click(); - }, 750); + }, 800); } } });