app: disable service worker on localhost

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/767/head
Varun Patil 2023-08-04 13:49:32 -07:00
parent 7e08319f78
commit 454a98dc23
1 changed files with 6 additions and 0 deletions

View File

@ -293,6 +293,12 @@ export default defineComponent({
async beforeMount() { async beforeMount() {
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
// Check if dev instance
if (window.location.hostname === 'localhost') {
console.warn('Service Worker is not enabled on localhost.');
return;
}
// Get the config before loading // Get the config before loading
const previousVersion = staticConfig.getSync('version'); const previousVersion = staticConfig.getSync('version');