summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorrstular <rok@stular.eu>2020-01-29 17:54:19 +0100
committerrstular <rok@stular.eu>2020-01-29 17:54:19 +0100
commitad02878561178429e4b8fcbd4594d9ce78f4c407 (patch)
tree075afb9e8bdc32925743a076f4bf1e2af1d7743c /js
parentTOS & PP changes (diff)
downloadbeziapp-ad02878561178429e4b8fcbd4594d9ce78f4c407.tar
beziapp-ad02878561178429e4b8fcbd4594d9ce78f4c407.tar.gz
beziapp-ad02878561178429e4b8fcbd4594d9ce78f4c407.tar.bz2
beziapp-ad02878561178429e4b8fcbd4594d9ce78f4c407.tar.lz
beziapp-ad02878561178429e4b8fcbd4594d9ce78f4c407.tar.xz
beziapp-ad02878561178429e4b8fcbd4594d9ce78f4c407.tar.zst
beziapp-ad02878561178429e4b8fcbd4594d9ce78f4c407.zip
Diffstat (limited to 'js')
-rw-r--r--js/app.js11
-rw-r--r--js/login.js2
2 files changed, 10 insertions, 3 deletions
diff --git a/js/app.js b/js/app.js
index d79fb88..97e671f 100644
--- a/js/app.js
+++ b/js/app.js
@@ -1,5 +1,12 @@
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/sw.js")
- .then(() => {})
+ .then(() => { })
.catch((err) => console.log("Service worker registration failed", err));
-} \ No newline at end of file
+}
+
+// Listen to messages from service workers.
+navigator.serviceWorker.addEventListener('message', (event) => {
+ if (event.data.msg === "install") {
+ window.location.replace("/index.html");
+ }
+}); \ No newline at end of file
diff --git a/js/login.js b/js/login.js
index ff8d4ed..a7ab25c 100644
--- a/js/login.js
+++ b/js/login.js
@@ -47,7 +47,7 @@ function login() {
localforage.setItem("password", password)
];
Promise.all(promises_to_run).then(function () {
- window.location.replace("/pages/teachers.html");
+ window.location.replace("/pages/timetable.html");
});
}