Fix cannot update (#5890)

This commit is contained in:
tamaina
2020-02-09 12:47:50 +09:00
committed by GitHub
parent 45cb5ff4ef
commit cc72f91465
3 changed files with 26 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ self.addEventListener('install', ev => {
caches.open(cacheName)
.then(cache => {
return cache.addAll([
'/'
`/?v=${version}`
]);
})
.then(() => self.skipWaiting())
@@ -45,7 +45,7 @@ self.addEventListener('fetch', ev => {
return response || fetch(ev.request);
})
.catch(() => {
return caches.match('/');
return caches.match(`/?v=${version}`);
})
);
});