ffmpeg implemented
This commit is contained in:
13
src/sw.js
13
src/sw.js
@@ -1,4 +1,4 @@
|
||||
const CACHE_NAME = 'radiocast-core-v1';
|
||||
const CACHE_NAME = 'radiocast-core-v2';
|
||||
const CORE_ASSETS = [
|
||||
'.',
|
||||
'index.html',
|
||||
@@ -11,6 +11,8 @@ const CORE_ASSETS = [
|
||||
];
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
// Activate updated SW as soon as it's installed.
|
||||
self.skipWaiting();
|
||||
event.waitUntil(
|
||||
caches.open(CACHE_NAME).then((cache) => cache.addAll(CORE_ASSETS))
|
||||
);
|
||||
@@ -18,9 +20,12 @@ self.addEventListener('install', (event) => {
|
||||
|
||||
self.addEventListener('activate', (event) => {
|
||||
event.waitUntil(
|
||||
caches.keys().then((keys) => Promise.all(
|
||||
keys.map((k) => { if (k !== CACHE_NAME) return caches.delete(k); return null; })
|
||||
))
|
||||
Promise.all([
|
||||
self.clients.claim(),
|
||||
caches.keys().then((keys) => Promise.all(
|
||||
keys.map((k) => { if (k !== CACHE_NAME) return caches.delete(k); return null; })
|
||||
)),
|
||||
])
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user