1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 13:45:56 +00:00

rework git update checking to be initiated by frontend, outside of runtime info output

This commit is contained in:
Andrew Dolgov
2018-12-16 19:05:37 +03:00
parent c3b8b6a2a1
commit 957c44d177
4 changed files with 46 additions and 40 deletions

View File

@@ -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];

View File

@@ -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";