| ... |
... |
@@ -1,7 +1,6 @@ |
| 1 |
1 |
if ('serviceWorker' in navigator) { |
| 2 |
2 |
navigator.serviceWorker.register('/bin/jsx/LiveTableServiceWorker?minify=false', { 'scope': '/bin/view/Membership'}) |
| 3 |
3 |
.then((reg) => { |
| 4 |
|
- reg.update(); |
| 5 |
5 |
if(reg.installing) { |
| 6 |
6 |
const sw = reg.installing || reg.waiting; |
| 7 |
7 |
sw.onstatechange = function() { |
| ... |
... |
@@ -12,9 +12,9 @@ |
| 12 |
12 |
}; |
| 13 |
13 |
} else if (reg.active) { |
| 14 |
14 |
// something's not right or SW is bypassed. previously-installed SW should have redirected this request to different page |
| 15 |
|
- throw(new Error('Service Worker is installed and not redirecting.')) |
|
14 |
+ handleError(new Error('Service Worker is installed and not redirecting.')) |
| 16 |
16 |
} |
| 17 |
|
- |
|
16 |
+ reg.update(); |
| 18 |
18 |
// registration worked |
| 19 |
19 |
console.log('Registration succeeded. Scope is ' + reg.scope); |
| 20 |
20 |
}).catch((error) => { |