mirror of
https://github.com/Unkn0wnCat/data-toolbox-site.git
synced 2025-06-18 15:51:36 +02:00
Fix serviceworker handling
This commit is contained in:
parent
bd36ee221c
commit
5344dc3422
2 changed files with 14 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "kevins-data-toolbox",
|
"name": "kevins-data-toolbox",
|
||||||
"version": "2.4.5",
|
"version": "2.4.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@loadable/component": "^5.15.0",
|
"@loadable/component": "^5.15.0",
|
||||||
|
|
|
@ -13,6 +13,7 @@ let eventListeners: Map<events, ((ev: Event) => void)[]> = new Map<events, ((ev:
|
||||||
|
|
||||||
let pendingUpdate = false;
|
let pendingUpdate = false;
|
||||||
|
|
||||||
|
if('serviceWorker' in navigator) {
|
||||||
navigator.serviceWorker.getRegistration().then((reg) => {
|
navigator.serviceWorker.getRegistration().then((reg) => {
|
||||||
if(reg && reg.waiting) {
|
if(reg && reg.waiting) {
|
||||||
pendingUpdate = true;
|
pendingUpdate = true;
|
||||||
|
@ -25,6 +26,7 @@ navigator.serviceWorker.getRegistration().then((reg) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const broadcast = new BroadcastChannel('sw-updates');
|
const broadcast = new BroadcastChannel('sw-updates');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue