summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assets/js/app.js.bvr26
-rw-r--r--dist/cache_name.txt2
-rwxr-xr-xdist/js/app.js28
-rwxr-xr-xdist/pages/about.html2
-rwxr-xr-xdist/sw.js4
5 files changed, 37 insertions, 25 deletions
diff --git a/assets/js/app.js.bvr b/assets/js/app.js.bvr
index 9bddb31..3d4cc6b 100644
--- a/assets/js/app.js.bvr
+++ b/assets/js/app.js.bvr
@@ -55,7 +55,7 @@ function gsecErrorHandlerUI(err) {
var update_app_function = async function () {
try {
- $.get("/cache_name.txt?cache_kill="+Date.now(), (data, status) => {
+ $.get("/cache_name.txt?cache_kill=" + Date.now(), (data, status) => {
var cache_name = data.split("///")[1].split("|||")[0];
var data_to_send = {
action: "checkversion",
@@ -103,16 +103,22 @@ var error_report_function = async function (msg, url, lineNo, columnNo, error) {
window.onerror = error_report_function;
window.onunhandledrejection = error_report_function;
+async function try_app_update() {
+ localforage.getItem("lastUpdate").then((data) => {
+ if (Math.floor(Date.now() / 1000) > Number(data) + BEZIAPP_UPDATE_INTERVAL) {
+ // trigger an update
+ localforage.setItem("lastUpdate", Math.floor(Date.now() / 1000)).then(() => {
+ update_app_function();
+ });
+ }
+ });
+}
document.addEventListener("DOMContentLoaded", () => {
- var update_interval = setInterval(() => { // ok, it's value is never read, so what?!
- localforage.getItem("lastUpdate").then((data) => {
- if (Math.floor(Date.now() / 1000) > Number(data) + BEZIAPP_UPDATE_INTERVAL) {
- // trigger an update
- localforage.setItem("lastUpdate", Math.floor(Date.now() / 1000)) .then(()=>{
- update_app_function();
- });
- }
- });
+ try_app_update();
+ var update_interval = setInterval(() => {
+
+ try_app_update();
+
}, 1000 * BEZIAPP_UPDATE_INTERVAL);
}); \ No newline at end of file
diff --git a/dist/cache_name.txt b/dist/cache_name.txt
index f5767e8..b5dfc87 100644
--- a/dist/cache_name.txt
+++ b/dist/cache_name.txt
@@ -2,4 +2,4 @@
-///site-static-1.0.14.3-beta-84aae4c|||
+///site-static-1.0.14.3-beta-170e5d4|||
diff --git a/dist/js/app.js b/dist/js/app.js
index dbd5dcf..01cf9e4 100755
--- a/dist/js/app.js
+++ b/dist/js/app.js
@@ -3,7 +3,7 @@
const app_version = "1.0.14.3-beta";
-const previous_commit = "84aae4ca1449c2cee942a49a0721e5b615f2a0c2";
+const previous_commit = "170e5d4b3a65adf8cfd85acb636aa91cf9d6af0c";
const BEZIAPP_UPDATE_INTERVAL = 300; // update vsakih 300 sekund
if ("serviceWorker" in navigator) {
@@ -58,7 +58,7 @@ function gsecErrorHandlerUI(err) {
var update_app_function = async function () {
try {
- $.get("/cache_name.txt?cache_kill="+Date.now(), (data, status) => {
+ $.get("/cache_name.txt?cache_kill=" + Date.now(), (data, status) => {
var cache_name = data.split("///")[1].split("|||")[0];
var data_to_send = {
action: "checkversion",
@@ -106,16 +106,22 @@ var error_report_function = async function (msg, url, lineNo, columnNo, error) {
window.onerror = error_report_function;
window.onunhandledrejection = error_report_function;
+async function try_app_update() {
+ localforage.getItem("lastUpdate").then((data) => {
+ if (Math.floor(Date.now() / 1000) > Number(data) + BEZIAPP_UPDATE_INTERVAL) {
+ // trigger an update
+ localforage.setItem("lastUpdate", Math.floor(Date.now() / 1000)).then(() => {
+ update_app_function();
+ });
+ }
+ });
+}
document.addEventListener("DOMContentLoaded", () => {
- var update_interval = setInterval(() => { // ok, it's value is never read, so what?!
- localforage.getItem("lastUpdate").then((data) => {
- if (Math.floor(Date.now() / 1000) > Number(data) + BEZIAPP_UPDATE_INTERVAL) {
- // trigger an update
- localforage.setItem("lastUpdate", Math.floor(Date.now() / 1000)) .then(()=>{
- update_app_function();
- });
- }
- });
+ try_app_update();
+ var update_interval = setInterval(() => {
+
+ try_app_update();
+
}, 1000 * BEZIAPP_UPDATE_INTERVAL);
})
diff --git a/dist/pages/about.html b/dist/pages/about.html
index 6a9230e..17a1250 100755
--- a/dist/pages/about.html
+++ b/dist/pages/about.html
@@ -160,7 +160,7 @@
<div class="row">
<p>
<small>
- ^HEAD 84aae4ca1449c2cee942a49a0721e5b615f2a0c2
+ ^HEAD 170e5d4b3a65adf8cfd85acb636aa91cf9d6af0c
</small>
</p>
</div>
diff --git a/dist/sw.js b/dist/sw.js
index 9b05b84..9e65f31 100755
--- a/dist/sw.js
+++ b/dist/sw.js
@@ -3,8 +3,8 @@
// Change version to cause cache refresh
-const static_cache_name = "site-static-1.0.14.3-beta-84aae4c";
-// commit before the latest is 84aae4ca1449c2cee942a49a0721e5b615f2a0c2
+const static_cache_name = "site-static-1.0.14.3-beta-170e5d4";
+// commit before the latest is 170e5d4b3a65adf8cfd85acb636aa91cf9d6af0c
// Got them with find . -not -path '*/\.*' | sed "s/.*/\"&\",/" | grep -v sw.js
// sw.js NE SME BITI CACHAN, ker vsebuje verzijo!