@ -12,8 +12,9 @@ customElements.define('m-page-menu', PageMenu)
class Setup {
async run() {
navigator.serviceWorker
.addEventListener('controllerchange', () => {
const sw = navigator.serviceWorker
sw.addEventListener('controllerchange', () => {
if (this.registration.active) {
window.location.reload(true)
}
@ -13,6 +13,7 @@ async function initCache() {
self.addEventListener("install", event => {
self.skipWaiting()
event.waitUntil(initCache())
})