2020-08-24 12:50:22 +00:00
|
|
|
self.addEventListener('install', function (e) {
|
|
|
|
e.waitUntil(
|
|
|
|
caches.open('hubl-store').then(function (cache) {
|
|
|
|
return cache.addAll([
|
|
|
|
'/components/hubl-reactivity.js',
|
|
|
|
'/components/hubl-search-users.js',
|
|
|
|
'/components/hubl-status.js',
|
2020-10-28 11:27:10 +00:00
|
|
|
'/components/sentry.js',
|
2020-08-24 12:50:22 +00:00
|
|
|
'/fonts/custom-icons.eot',
|
|
|
|
'/fonts/custom-icons.svg',
|
|
|
|
'/fonts/custom-icons.ttf',
|
|
|
|
'/fonts/custom-icons.woff',
|
|
|
|
'/fonts/FacitBold.eot',
|
|
|
|
'/fonts/FacitBold.svg',
|
|
|
|
'/fonts/FacitBold.ttf',
|
|
|
|
'/fonts/FacitBold.woff',
|
|
|
|
'/fonts/FacitRegular.eot',
|
|
|
|
'/fonts/FacitRegular.svg',
|
|
|
|
'/fonts/FacitRegular.ttf',
|
|
|
|
'/fonts/FacitRegular.woff',
|
|
|
|
'/fonts/material-design-icons.eot',
|
|
|
|
'/fonts/material-design-icons.svg',
|
|
|
|
'/fonts/material-design-icons.ttf',
|
|
|
|
'/fonts/material-design-icons.woff',
|
|
|
|
'/fonts/material-design-icons.woff2',
|
|
|
|
'/fonts/RefrigeratorDelxW01Bold.eot',
|
|
|
|
'/fonts/RefrigeratorDelxW01Bold.svg',
|
|
|
|
'/fonts/RefrigeratorDelxW01Bold.ttf',
|
|
|
|
'/fonts/RefrigeratorDelxW01Bold.woff',
|
|
|
|
'/fonts/simple-line-icons.eot',
|
|
|
|
'/fonts/simple-line-icons.svg',
|
|
|
|
'/fonts/simple-line-icons.ttf',
|
|
|
|
'/fonts/simple-line-icons.woff',
|
|
|
|
'/fonts/simple-line-icons.woff2',
|
|
|
|
'/images/add-user.svg',
|
|
|
|
'/images/alien.svg',
|
2020-10-28 11:27:10 +00:00
|
|
|
'/images/appointment.svg',
|
2020-08-24 12:50:22 +00:00
|
|
|
'/images/arrow-down.svg',
|
|
|
|
'/images/calendar.svg',
|
|
|
|
'/images/chevron-down.png',
|
|
|
|
'/images/favicon.png',
|
2020-10-28 11:27:10 +00:00
|
|
|
'/images/file.svg',
|
2020-08-24 12:50:22 +00:00
|
|
|
'/images/hubl-icon-192.png',
|
|
|
|
'/images/hubl-icon-512.png',
|
|
|
|
'/images/logo.png',
|
2020-10-28 11:27:10 +00:00
|
|
|
'/images/send.png',
|
|
|
|
'/images/vote.svg',
|
|
|
|
'/locales/es.json',
|
|
|
|
'/locales/fr.json',
|
2020-08-24 12:50:22 +00:00
|
|
|
'/scripts/index.js',
|
|
|
|
'/syles/index.css',
|
|
|
|
'/index.html',
|
2020-10-28 11:27:10 +00:00
|
|
|
'/manifest.webmanifest',
|
2020-08-24 12:50:22 +00:00
|
|
|
'/'
|
|
|
|
]);
|
|
|
|
})
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
//TODO: Can't use fetch because of unpkg, e.request is missing a part of the package name "@startinblox/core" become "@startinblox"
|
2020-10-28 11:27:10 +00:00
|
|
|
self.addEventListener('fetch', function (e) {
|
2020-08-24 12:50:22 +00:00
|
|
|
// Handle direct loading /xyz/ when server is unjoinable
|
2020-10-28 11:27:10 +00:00
|
|
|
if (e.request.mode === 'navigate') {
|
|
|
|
e.respondWith(caches.match('/'));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
e.respondWith(
|
|
|
|
fetch(e.request, {
|
|
|
|
credentials: 'include'
|
|
|
|
}).catch(function() {
|
|
|
|
return caches.match(e.request);
|
|
|
|
})
|
|
|
|
);
|
|
|
|
});
|