From cdf17dfd5d57b5461831868feb2497073a9b19d6 Mon Sep 17 00:00:00 2001 From: sijanec Date: Mon, 8 Jun 2020 23:33:02 +0200 Subject: forgot a semi-crucial thingy --- assets/js/app.js.bvr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'assets/js/app.js.bvr') diff --git a/assets/js/app.js.bvr b/assets/js/app.js.bvr index c252c40..9bddb31 100644 --- a/assets/js/app.js.bvr +++ b/assets/js/app.js.bvr @@ -107,9 +107,11 @@ window.onunhandledrejection = error_report_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) > data + BEZIAPP_UPDATE_INTERVAL) { + if (Math.floor(Date.now() / 1000) > Number(data) + BEZIAPP_UPDATE_INTERVAL) { // trigger an update - update_app_function(); + localforage.setItem("lastUpdate", Math.floor(Date.now() / 1000)) .then(()=>{ + update_app_function(); + }); } }); }, 1000 * BEZIAPP_UPDATE_INTERVAL); -- cgit v1.2.3