@kispace-io/gs-lib 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.html +0 -16
- package/package.json +1 -1
- package/public/index.html +0 -16
package/dist/index.html
CHANGED
|
@@ -42,22 +42,6 @@
|
|
|
42
42
|
if ('serviceWorker' in navigator) {
|
|
43
43
|
window.onload = () => {
|
|
44
44
|
navigator.serviceWorker.register('/sw.js').then(registration => {
|
|
45
|
-
// Check for updates
|
|
46
|
-
registration.addEventListener('updatefound', () => {
|
|
47
|
-
const newWorker = registration.installing;
|
|
48
|
-
if (newWorker) {
|
|
49
|
-
newWorker.addEventListener('statechange', () => {
|
|
50
|
-
if (newWorker.state === 'installed' && navigator.serviceWorker.controller) {
|
|
51
|
-
// New version available
|
|
52
|
-
if (confirm('A new version of the app is available. Reload to update?')) {
|
|
53
|
-
newWorker.postMessage({ type: 'SKIP_WAITING' });
|
|
54
|
-
window.location.reload();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
45
|
// Listen for service worker messages
|
|
62
46
|
navigator.serviceWorker.addEventListener('message', event => {
|
|
63
47
|
if (event.data && event.data.type === 'RELOAD') {
|
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -42,22 +42,6 @@
|
|
|
42
42
|
if ('serviceWorker' in navigator) {
|
|
43
43
|
window.onload = () => {
|
|
44
44
|
navigator.serviceWorker.register('/sw.js').then(registration => {
|
|
45
|
-
// Check for updates
|
|
46
|
-
registration.addEventListener('updatefound', () => {
|
|
47
|
-
const newWorker = registration.installing;
|
|
48
|
-
if (newWorker) {
|
|
49
|
-
newWorker.addEventListener('statechange', () => {
|
|
50
|
-
if (newWorker.state === 'installed' && navigator.serviceWorker.controller) {
|
|
51
|
-
// New version available
|
|
52
|
-
if (confirm('A new version of the app is available. Reload to update?')) {
|
|
53
|
-
newWorker.postMessage({ type: 'SKIP_WAITING' });
|
|
54
|
-
window.location.reload();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
45
|
// Listen for service worker messages
|
|
62
46
|
navigator.serviceWorker.addEventListener('message', event => {
|
|
63
47
|
if (event.data && event.data.type === 'RELOAD') {
|