diff --git a/.idea/misc.xml b/.idea/misc.xml index 7c7709e01ee2155b7c0a4e707b518b02f2274eb5..f967d638a7fcfd76693951f28f989c088f769539 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -6,5 +6,5 @@ <component name="NodePackageJsonFileManager"> <packageJsonPaths /> </component> - <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (school-apps)" project-jdk-type="Python SDK" /> + <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (SchoolApps)" project-jdk-type="Python SDK" /> </project> \ No newline at end of file diff --git a/.idea/school-apps.iml b/.idea/school-apps.iml index d0b5ddd7b4dbd80e5134ef103cfcf8264785005a..96873b7da10fa79cb630f41924905744bec63b0c 100644 --- a/.idea/school-apps.iml +++ b/.idea/school-apps.iml @@ -23,7 +23,7 @@ <excludeFolder url="file://$MODULE_DIR$/env" /> <excludeFolder url="file://$MODULE_DIR$/schoolapps/staticcollect" /> </content> - <orderEntry type="jdk" jdkName="Python 3.7 (school-apps)" jdkType="Python SDK" /> + <orderEntry type="jdk" jdkName="Python 3.7 (SchoolApps)" jdkType="Python SDK" /> <orderEntry type="sourceFolder" forTests="false" /> </component> <component name="TemplatesService"> @@ -48,7 +48,4 @@ </list> </option> </component> - <component name="TestRunnerService"> - <option name="PROJECT_TEST_RUNNER" value="Unittests" /> - </component> </module> \ No newline at end of file diff --git a/schoolapps/static/common/serviceworker.js b/schoolapps/static/common/serviceworker.js index 74403d78f6e9dddb80d31a36dbfeedcd36eddb10..3821eed2cb7d571b754b365fafa931bf4ea064be 100644 --- a/schoolapps/static/common/serviceworker.js +++ b/schoolapps/static/common/serviceworker.js @@ -96,7 +96,7 @@ function cacheFirstFetch(event) { // The response was not found in the cache so we look for it on the server return fetch(event.request) .then(function (response) { - // If request was success, add or update it in the cache + // If request was successful, add or update it in the cache event.waitUntil(updateCache(event.request, response.clone())); return response; @@ -120,12 +120,12 @@ function networkFirstFetch(event) { event.respondWith( fetch(event.request) .then(function (response) { - // If request was success, add or update it in the cache + // If request was successful, add or update it in the cache event.waitUntil(updateCache(event.request, response.clone())); return response; }) .catch(function (error) { - console.log("[SchoolApps PWA] Network request Failed. Serving content from cache: " + error); + console.log("[SchoolApps PWA] Network request failed. Serving content from cache: " + error); return fromCache(event.request); }) ); @@ -138,7 +138,7 @@ function fromCache(request) { return caches.open(CACHE).then(function (cache) { return cache.match(request).then(function (matching) { if (!matching || matching.status === 404) { - return Promise.reject("no-match"); + return caches.match(offlineFallbackPage); } return matching;