Frontend checks if localhost before req sw.js.

This commit is contained in:
2020-11-20 21:25:39 +01:00
parent d36aad3f9e
commit 51e11d0df0
2 changed files with 6 additions and 11 deletions

View File

@@ -9,11 +9,11 @@ var serviceWorkerRegistrationMixin = {
localStorage.removeItem("push");
}
}
this.registerPushListener();
this.registerServiceWorker();
if (__ENV__ == "development") {
if (window.location.href.includes('localhost')) {
console.info("Service worker manually disabled while on localhost.")
} else {
this.registerPushListener();
this.registerServiceWorker();
}
},
methods: {