mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-02-16 18:14:23 +01:00
Attempt to fix page load issues on staging server
This commit is contained in:
parent
0c1a283867
commit
64d28f0b1f
1 changed files with 13 additions and 9 deletions
|
@ -56,15 +56,19 @@ self.addEventListener('activate', function (event) {
|
||||||
// Basic offline mode
|
// Basic offline mode
|
||||||
// Just respond with an offline error page for now
|
// Just respond with an offline error page for now
|
||||||
self.addEventListener('fetch', function(event) {
|
self.addEventListener('fetch', function(event) {
|
||||||
event.respondWith(
|
if (event.request.url.indexOf('stage.pony.fm') > -1) {
|
||||||
caches.match(event.request).then(function(response) {
|
event.respondWith(fetch(event.request));
|
||||||
return response || fetch(event.request);
|
} else {
|
||||||
}).catch(function () {
|
event.respondWith(
|
||||||
if (event.request.mode == 'navigate') {
|
caches.match(event.request).then(function (response) {
|
||||||
return caches.match('/offline.html');
|
return response || fetch(event.request);
|
||||||
}
|
}).catch(function () {
|
||||||
})
|
if (event.request.mode == 'navigate') {
|
||||||
)
|
return caches.match('/offline.html');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
self.addEventListener('push', function(event) {
|
self.addEventListener('push', function(event) {
|
||||||
|
|
Loading…
Reference in a new issue