summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-16 12:43:53 +0300
committerAndrew Dolgov <[email protected]>2018-12-16 12:43:53 +0300
commitc3b8b6a2a19102f958a9e4c2c007d83abe52ef9b (patch)
tree676c8c639edac6a9f6ae0223a0d6747ec2b3436f /js
parent54ce930b8d97cff9443ee28a3165c90e67689187 (diff)
also prevent multiple requests
Diffstat (limited to 'js')
-rwxr-xr-xjs/Headlines.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/Headlines.js b/js/Headlines.js
index 19ab69d16..783067f30 100755
--- a/js/Headlines.js
+++ b/js/Headlines.js
@@ -4,6 +4,7 @@ define(["dojo/_base/declare"], function (declare) {
Headlines = {
vgroup_last_feed: undefined,
_headlines_scroll_timeout: 0,
+ _observer_counters_timeout: 0,
headlines: [],
current_first_id: 0,
row_observer: new MutationObserver((mutations) => {
@@ -141,7 +142,9 @@ define(["dojo/_base/declare"], function (declare) {
if (promises.length > 0)
Promise.all([promises]).then(() => {
- setTimeout(() => {
+ window.clearTimeout(this._observer_counters_timeout);
+
+ this._observer_counters_timeout = setTimeout(() => {
Feeds.requestCounters(true);
}, 1000);
});