Skip to content
Snippets Groups Projects
Commit f8763b28 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier
Browse files

re-enable sw

parent 0c4c3581
No related branches found
No related tags found
1 merge request!198Web manifest generation + Core 0.13
Pipeline #8341 passed
......@@ -5,6 +5,7 @@ self.addEventListener('install', function (e) {
'/components/hubl-reactivity.js',
'/components/hubl-search-users.js',
'/components/hubl-status.js',
'/components/sentry.js',
'/fonts/custom-icons.eot',
'/fonts/custom-icons.svg',
'/fonts/custom-icons.ttf',
......@@ -33,16 +34,23 @@ self.addEventListener('install', function (e) {
'/fonts/simple-line-icons.woff2',
'/images/add-user.svg',
'/images/alien.svg',
'/images/appointment.svg',
'/images/arrow-down.svg',
'/images/calendar.svg',
'/images/chevron-down.png',
'/images/favicon.png',
'/images/file.svg',
'/images/hubl-icon-192.png',
'/images/hubl-icon-512.png',
'/images/logo.png',
'/images/send.png',
'/images/vote.svg',
'/locales/es.json',
'/locales/fr.json',
'/scripts/index.js',
'/syles/index.css',
'/index.html',
'/manifest.webmanifest',
'/'
]);
})
......@@ -50,17 +58,17 @@ self.addEventListener('install', function (e) {
});
//TODO: Can't use fetch because of unpkg, e.request is missing a part of the package name "@startinblox/core" become "@startinblox"
// self.addEventListener('fetch', function (e) {
self.addEventListener('fetch', function (e) {
// Handle direct loading /xyz/ when server is unjoinable
// if (e.request.mode === 'navigate') {
// e.respondWith(caches.match('/'));
// return;
// }
// e.respondWith(
// fetch(e.request, {
// credentials: 'include'
// }).catch(function() {
// return caches.match(e.request);
// })
// );
// });
\ No newline at end of file
if (e.request.mode === 'navigate') {
e.respondWith(caches.match('/'));
return;
}
e.respondWith(
fetch(e.request, {
credentials: 'include'
}).catch(function() {
return caches.match(e.request);
})
);
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment