From 4bdf08e3aa64a09658bb38f15713ef492ca95afa Mon Sep 17 00:00:00 2001 From: Azgaar Date: Fri, 13 May 2022 22:42:26 +0300 Subject: [PATCH] cleanup --- main.js | 2 +- modules/dynamic/installation.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index a677d7ad..4489eacd 100644 --- a/main.js +++ b/main.js @@ -10,7 +10,7 @@ const TIME = DEBUG || !PRODUCTION; const WARN = true; const ERROR = true; -if ("serviceWorker" in navigator) { +if (PRODUCTION && "serviceWorker" in navigator) { window.addEventListener("load", () => { navigator.serviceWorker.register("./sw.js").catch(err => { console.error("ServiceWorker registration failed: ", err); diff --git a/modules/dynamic/installation.js b/modules/dynamic/installation.js index c6c23ee5..a9f2f789 100644 --- a/modules/dynamic/installation.js +++ b/modules/dynamic/installation.js @@ -33,10 +33,13 @@ function createButton() { } function openDialog() { - alertMessage.innerHTML = /* html */ `You can install the tool so that it will look and feel like desktop application`; + alertMessage.innerHTML = /* html */ `You can install the tool so that it will look and feel like desktop application: + have its own icon on your home screen and work offline with some limitations + `; $("#alert").dialog({ resizable: false, title: "Install the Application", + width: "38em", buttons: { Install: function () { $(this).dialog("close");