diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/app.js | 11 | ||||
-rw-r--r-- | js/login.js | 2 |
2 files changed, 10 insertions, 3 deletions
@@ -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"); }); } |