summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-16 19:05:37 +0300
committerAndrew Dolgov <[email protected]>2018-12-16 19:05:37 +0300
commit957c44d177e6577e2f3b98560c8f2b67883806d4 (patch)
treeb0f4de5b06289d68c841f00e720ce7bef3165b0f /js
parentc3b8b6a2a19102f958a9e4c2c007d83abe52ef9b (diff)
rework git update checking to be initiated by frontend, outside of runtime info output
Diffstat (limited to 'js')
-rw-r--r--js/AppBase.js8
-rw-r--r--js/tt-rss.js20
2 files changed, 20 insertions, 8 deletions
diff --git a/js/AppBase.js b/js/AppBase.js
index bb2c3cbcc..121b7aa85 100644
--- a/js/AppBase.js
+++ b/js/AppBase.js
@@ -262,14 +262,6 @@ define(["dojo/_base/declare"], function (declare) {
return;
}
- if (k == "update_result") {
- if (v) {
- Element.show("updates-available");
- } else {
- Element.hide("updates-available");
- }
- }
-
if (k == "recent_log_events") {
const alert = $$(".log-alert")[0];
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";