From 5a561d442090daccc875ccd76c3da0aed656109d Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Mon, 10 Aug 2020 20:04:18 +0200 Subject: [PATCH] New Release --- gabenparadise/public/manifest.json | 2 +- gabenparadise/src/registerServiceWorker.js | 6 +++++- gabenparadise/src/service-worker.js | 5 +++-- gabenparadise/vue.config.js | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gabenparadise/public/manifest.json b/gabenparadise/public/manifest.json index 02224c4..f0f0981 100644 --- a/gabenparadise/public/manifest.json +++ b/gabenparadise/public/manifest.json @@ -1,7 +1,7 @@ { "name": "Gaben Paradise", "short_name": "Gaben Paradise", - "theme_color": "#24ACF2", + "theme_color": "#0a0a0a", "icons": [ { "src": "./img/icons/android-chrome-192x192.png", diff --git a/gabenparadise/src/registerServiceWorker.js b/gabenparadise/src/registerServiceWorker.js index 78ed1b0..148e152 100644 --- a/gabenparadise/src/registerServiceWorker.js +++ b/gabenparadise/src/registerServiceWorker.js @@ -49,7 +49,11 @@ if (process.env.NODE_ENV === "production") { }, updated() { console.log("New content is available; please refresh."); - //window.location.reload(true); + navigator.serviceWorker.getRegistrations().then(function (registrations) { + for (let registration of registrations) { + registration.update() + } + }) }, offline() { console.log( diff --git a/gabenparadise/src/service-worker.js b/gabenparadise/src/service-worker.js index b6c6a0d..8eacfe5 100644 --- a/gabenparadise/src/service-worker.js +++ b/gabenparadise/src/service-worker.js @@ -1,11 +1,12 @@ -/*self.__precacheManifest = [].concat(self.__precacheManifest || []);*/ +self.__precacheManifest = [].concat(self.__precacheManifest || []); // workbox.setConfig({ // debug: true // }); -//workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); +workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); +console.log('Loading SW'); self.addEventListener("push", function (event) { console.log('Received a push message', event); if (event.data) { diff --git a/gabenparadise/vue.config.js b/gabenparadise/vue.config.js index 41916a7..9bf722a 100644 --- a/gabenparadise/vue.config.js +++ b/gabenparadise/vue.config.js @@ -2,6 +2,7 @@ module.exports = { pwa: { name: 'Gaben Paradise', workboxPluginMode: 'InjectManifest', + themeColor: '#0a0a0a', workboxOptions:{ swSrc: "src/service-worker.js" },