mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-10 11:24:10 -04:00
Merge pull request #2577 from alphagov/disable_ajax_if_inactive
Page stops auto-refreshing when it's not active
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
var poll = function(renderer, resource, queue, interval, form) {
|
||||
|
||||
if (queue.push(renderer) === 1) $.ajax(
|
||||
if (document.visibilityState !== "hidden" && queue.push(renderer) === 1) $.ajax(
|
||||
resource,
|
||||
{
|
||||
'method': form ? 'post' : 'get',
|
||||
@@ -36,7 +36,6 @@
|
||||
setTimeout(
|
||||
() => poll(...arguments), interval
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
Modules.UpdateContent = function() {
|
||||
|
||||
Reference in New Issue
Block a user