mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-22 12:01:15 -04:00
parent
4ce5d47b54
commit
2802092a15
@ -991,10 +991,10 @@ function initServiceWorkerMessaging () {
|
|||||||
action: 'init'
|
action: 'init'
|
||||||
});
|
});
|
||||||
} else if (serviceWorkerRegistration) {
|
} 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...');
|
console.warn('The Service Worker needs more time to load, or else the app was force-refreshed...');
|
||||||
serviceWorkerRegistration = null;
|
serviceWorkerRegistration = null;
|
||||||
setTimeout(initServiceWorkerMessaging, 1600);
|
setTimeout(initServiceWorkerMessaging, 3000);
|
||||||
} else if (params.contentInjectionMode === 'serviceworker') {
|
} else if (params.contentInjectionMode === 'serviceworker') {
|
||||||
console.error('The Service Worker is not controlling the current page! We have to reload.');
|
console.error('The Service Worker is not controlling the current page! We have to reload.');
|
||||||
// Turn off failsafe, as this is a controlled reboot
|
// Turn off failsafe, as this is a controlled reboot
|
||||||
@ -1010,7 +1010,7 @@ function initServiceWorkerMessaging () {
|
|||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
params.themeChanged = true;
|
params.themeChanged = true;
|
||||||
document.getElementById('btnHome').click();
|
document.getElementById('btnHome').click();
|
||||||
}, 750);
|
}, 800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user