Fix TTL calculation

This commit is contained in:
Jeremy Likness 2019-12-05 10:51:21 -08:00
parent e2d52d32e9
commit 0b60742e8a

3
pwa.js
View File

@ -95,7 +95,7 @@ class Pwa {
if (typeof url === 'string') { if (typeof url === 'string') {
const extension = this.getFileExtension(url); const extension = this.getFileExtension(url);
return ~this.TTL_EXCEPTIONS.indexOf(extension) ? return ~this.TTL_EXCEPTIONS.indexOf(extension) ?
this.MAX_TTL : null; null : this.MAX_TTL;
} }
return null; return null;
} }
@ -224,6 +224,7 @@ class Pwa {
/** /**
* Sadly this is a pathetic hack to workaround JsDoc limitations * Sadly this is a pathetic hack to workaround JsDoc limitations
* Casting what the IDE thinks is Window to service worker scope
* @type {any} */ * @type {any} */
const _self = self; const _self = self;
var pwa = new Pwa(/**@type {ServiceWorkerGlobalScope}*/(_self)); var pwa = new Pwa(/**@type {ServiceWorkerGlobalScope}*/(_self));