Просмотр исходного кода

Merge pull request #137 from akash-joshi/patch-1

Update sw.js
Pouria Ezzati 7 лет назад
Родитель
Сommit
92e13fbf3d
1 измененных файлов с 2 добавлено и 4 удалено
  1. 2 4
      server/offline/sw.js

+ 2 - 4
server/offline/sw.js

@@ -1,8 +1,6 @@
 // This is the "Offline copy of pages" service worker
 
-// Install stage sets up the index page (home page) in the cache and opens a new cache
-const { self } = window;
-
+// eslint-disable-next-line no-restricted-globals
 self.addEventListener('install', event => {
   const indexPage = new Request('index.html');
   event.waitUntil(
@@ -12,7 +10,7 @@ self.addEventListener('install', event => {
   );
 });
 
-// If any fetch fails, it will look for the request in the cache and serve it from there first
+// eslint-disable-next-line no-restricted-globals
 self.addEventListener('fetch', event => {
   const updateCache = request =>
     caches