From d6203bf3508ba77e3943ddc412eb562edb327f22 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 24 Feb 2021 09:47:26 +0300 Subject: try to calculate counters conditionally based on feed ids --- js/Headlines.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'js/Headlines.js') diff --git a/js/Headlines.js b/js/Headlines.js index abb96d4ce..1ba52a6b8 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -7,7 +7,7 @@ const Headlines = { vgroup_last_feed: undefined, _headlines_scroll_timeout: 0, - _observer_counters_timeout: 0, + //_observer_counters_timeout: 0, headlines: [], current_first_id: 0, _scroll_reset_timeout: false, @@ -149,38 +149,38 @@ const Headlines = { const promises = []; if (ops.tmark.length != 0) - promises.push(xhr.post("backend.php", + promises.push(xhr.json("backend.php", {op: "rpc", method: "markSelected", ids: ops.tmark.toString(), cmode: 2})); if (ops.tpub.length != 0) - promises.push(xhr.post("backend.php", + promises.push(xhr.json("backend.php", {op: "rpc", method: "publishSelected", ids: ops.tpub.toString(), cmode: 2})); if (ops.read.length != 0) - promises.push(xhr.post("backend.php", + promises.push(xhr.json("backend.php", {op: "rpc", method: "catchupSelected", ids: ops.read.toString(), cmode: 0})); if (ops.unread.length != 0) - promises.push(xhr.post("backend.php", + promises.push(xhr.json("backend.php", {op: "rpc", method: "catchupSelected", ids: ops.unread.toString(), cmode: 1})); const scores = Object.keys(ops.rescore); if (scores.length != 0) { scores.forEach((score) => { - promises.push(xhr.post("backend.php", + promises.push(xhr.json("backend.php", {op: "article", method: "setScore", id: ops.rescore[score].toString(), score: score})); }); } - if (promises.length > 0) + /*if (promises.length > 0) Promise.all([promises]).then(() => { window.clearTimeout(this._observer_counters_timeout); this._observer_counters_timeout = setTimeout(() => { - Feeds.requestCounters(true); + Feeds.requestCounters(); }, 1000); - }); + });*/ }, click: function (event, id, in_body) { -- cgit v1.2.3