diff --git a/breccia_mapper/static/js/serviceworker.js b/breccia_mapper/static/js/serviceworker.js index 5c21126..90d7bea 100644 --- a/breccia_mapper/static/js/serviceworker.js +++ b/breccia_mapper/static/js/serviceworker.js @@ -1,9 +1,10 @@ var staticCacheName = "django-pwa-v" + new Date().getTime(); var filesToCache = [ - "/offline", + "/offline/", "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/fontawesome.min.css", "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/solid.min.css", "/static/css/global.css", + "/static/js/serviceworker.js", "/static/hijack/hijack.min.css", "/media/icon-192x192.png", ]; @@ -41,7 +42,7 @@ self.addEventListener("fetch", event => { return response || fetch(event.request); }) .catch(() => { - return caches.match('offline'); + return caches.match('/offline/'); }) ) }); \ No newline at end of file diff --git a/breccia_mapper/templates/offline.html b/breccia_mapper/templates/offline.html new file mode 100644 index 0000000..6644d64 --- /dev/null +++ b/breccia_mapper/templates/offline.html @@ -0,0 +1,8 @@ +{% extends 'base.html' %} + +{% block content %} +

Offline

+ +

You are currently offline. Please connect to a network to use this platform.

+ +{% endblock %} \ No newline at end of file