v0.6.3: immediate update on new version (skipping 24h service worker cooldown)
This commit is contained in:
parent
12048f3a49
commit
2a0b6dbfe6
6 changed files with 35 additions and 16 deletions
20
main.js
20
main.js
|
@ -1,4 +1,4 @@
|
|||
const version = '0.6.2'
|
||||
const version = '0.6.3'
|
||||
const minorVersion = version.split('.').splice(0, 2).join('.');
|
||||
const numberFormat = new Intl.NumberFormat('de-DE', {
|
||||
maximumFractionDigits: 1
|
||||
|
@ -34,8 +34,18 @@ function closeDialog(selector) {
|
|||
}
|
||||
|
||||
if ("serviceWorker" in navigator) {
|
||||
console.log('installing sw');
|
||||
navigator.serviceWorker.register("/sw.js").then((registration) => {
|
||||
console.log('done installing sw');
|
||||
});
|
||||
navigator.serviceWorker.register("/sw.js")
|
||||
.then((registration) => {
|
||||
if (registration.installing) {
|
||||
console.log('New Service Worker is installing...');
|
||||
} else if (registration.waiting) {
|
||||
console.log('Installed new service worker. Waiting for Update (up to 24h).');
|
||||
} else if (registration.active) {
|
||||
console.log('Service Worker is up to date.');
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
// registration failed
|
||||
console.error(`Registration failed with ${error}`);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue