diff --git a/static/js/as.js b/static/js/as.js deleted file mode 100644 index 4c617cf..0000000 --- a/static/js/as.js +++ /dev/null @@ -1,32 +0,0 @@ -(function () { - - var swRegistration; - var newWorker; - var isRefreshing = false; - var pathname = window.location.pathname; - var deferredPrompt; - - if ('serviceWorker' in navigator) { - console.info('Service Worker is supported'); - - window.addEventListener('load', function () { - navigator.serviceWorker.register('/sw.js', { - updateViaCache: 'all', - }).then(function (registration) { - swRegistration = registration; - console.log('[SW] registration successful with scope: ', swRegistration.scope); - console.log('[SW] is waiting: ', swRegistration.waiting); - - navigator.serviceWorker.addEventListener('controllerchange', function () { - if (isRefreshing) { - return; - } - window.location.reload(); - isRefreshing = true; - }); - }, function (err) { - console.log('[SW] registration failed: ', err); - }); - }); - } -})(); diff --git a/static/sw.js b/static/sw.js deleted file mode 100644 index 95d1303..0000000 --- a/static/sw.js +++ /dev/null @@ -1,38 +0,0 @@ -var CACHE_NAME = 'ml-03'; -var urlsToCache = [ - '/css/bootstrap-5.3.0.min.css', - '/css/styles.css', - '/js/bootstrap-5.3.0.min.js', - '/js/react.production.min.js', - '/js/react-dom.production.min.js', - '/js/prop-types.min.js', - '/js/react-beautiful-dnd.min.js', - '/js/uuid_v4@latest.js', -]; - -self.addEventListener('install', function(event) { - console.log('[SW] Install'); - event.waitUntil( - caches.open(CACHE_NAME) - .then(function(cache) { - console.log('[SW] add to cache'); - return cache.addAll(urlsToCache); - }) - ); -}); - -self.addEventListener('fetch', function (event) { - console.log('[SW] Fetch'); - event.respondWith( - caches.match(event.request).then(function (response) { - return response || fetch(event.request); - }) - ); -}); - -self.addEventListener('message', function (event) { - if (event.data.action === 'skipWaiting') { - self.skipWaiting(); - caches.delete(CACHE_NAME); - } -}); \ No newline at end of file diff --git a/templates/_base.html b/templates/_base.html index 7404a8e..b241e9c 100644 --- a/templates/_base.html +++ b/templates/_base.html @@ -168,9 +168,6 @@ - - -