From 590bd9dc453d6a375b4bbf317e9f8804abbe452f Mon Sep 17 00:00:00 2001 From: Erik Roemmelt Date: Mon, 11 Feb 2019 15:40:19 +0100 Subject: [PATCH] fix app icons --- public/index.html | 10 +++++----- public/manifest.json | 4 ++-- public/serviceWorker.js | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/public/index.html b/public/index.html index 71ba337..fc387cc 100644 --- a/public/index.html +++ b/public/index.html @@ -28,14 +28,14 @@ - + - - - - + + + + diff --git a/public/manifest.json b/public/manifest.json index 2e1cfb9..1307fee 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -3,12 +3,12 @@ "name": "OHM News", "icons": [ { - "src":"img/launcher/launcher_app_icon_192.png", + "src":"img/launcher/android_launcher_app_icon_192.png", "type": "image/png", "sizes": "192x192" }, { - "src":"img/launcher/launcher_app_icon_512.png", + "src":"img/launcher/android_launcher_app_icon_512.png", "type": "image/png", "sizes": "512x512" } diff --git a/public/serviceWorker.js b/public/serviceWorker.js index 1a70fcb..fbdc177 100644 --- a/public/serviceWorker.js +++ b/public/serviceWorker.js @@ -110,7 +110,7 @@ self.addEventListener('activate', event => { self.addEventListener('fetch', event => { // Provide HTTPS URL for query data. //const postMsgURL = 'https://me.efi.th-nuernberg.de/om/api/createMsg'; - const postMsgURL = 'http://localhost:8013/api/createMsg'; + //const postMsgURL = 'http://localhost:8013/api/createMsg'; /* We should only cache GET requests, and deal with the rest of method in the client-side, by handling failed POST,PUT,PATCH,etc. requests. */ @@ -133,7 +133,6 @@ self.addEventListener('fetch', event => { const networkPromise = fetch(requestURL); const cachedResponse = await caches.match(event.request); - if (cachedResponse) return cachedResponse; const networkResponse = await networkPromise; // Check if response is valid, status is 200, response type is basic @@ -147,12 +146,12 @@ self.addEventListener('fetch', event => { // be read once. Placing a response in the cache counts as a read. cache.put(event.request, networkResponse.clone()); + if (cachedResponse) return cachedResponse; console.log('[ServiceWorker] Fetch', event.request); return networkResponse; } catch (err) { // Report a lack of connectivity to the user. console.log('No Network connection: ',err); - return cachedResponse; } }()); });