From 957c44d177e6577e2f3b98560c8f2b67883806d4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 16 Dec 2018 19:05:37 +0300 Subject: rework git update checking to be initiated by frontend, outside of runtime info output --- js/tt-rss.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index 7635e3a83..99b44549b 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -163,11 +163,31 @@ require(["dojo/_base/kernel", window.setInterval(() => { Feeds.updateRandom() }, 30 * 1000); } + if (App.getInitParam('check_for_updates')) { + window.setInterval(() => { + App.checkForUpdates(); + }, 3600 * 1000); + } + console.log("second stage ok"); PluginHost.run(PluginHost.HOOK_INIT_COMPLETE, null); }, + checkForUpdates: function() { + console.log('checking for updates...'); + + xhrJson("backend.php", {op: 'rpc', method: 'checkforupdates'}) + .then((reply) => { + console.log('update reply', reply); + + if (reply.id) { + $("updates-available").show(); + } else { + $("updates-available").hide(); + } + }); + }, updateTitle: function() { let tmp = "Tiny Tiny RSS"; -- cgit v1.2.3-54-g00ecf