aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/app/javascript/action_cable/connection_monitor.js
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/app/javascript/action_cable/connection_monitor.js')
-rw-r--r--actioncable/app/javascript/action_cable/connection_monitor.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/actioncable/app/javascript/action_cable/connection_monitor.js b/actioncable/app/javascript/action_cable/connection_monitor.js
index f0e75ae137..312a71d154 100644
--- a/actioncable/app/javascript/action_cable/connection_monitor.js
+++ b/actioncable/app/javascript/action_cable/connection_monitor.js
@@ -21,7 +21,7 @@ class ConnectionMonitor {
this.startedAt = now()
delete this.stoppedAt
this.startPolling()
- document.addEventListener("visibilitychange", this.visibilityDidChange)
+ addEventListener("visibilitychange", this.visibilityDidChange)
logger.log(`ConnectionMonitor started. pollInterval = ${this.getPollInterval()} ms`)
}
}
@@ -30,7 +30,7 @@ class ConnectionMonitor {
if (this.isRunning()) {
this.stoppedAt = now()
this.stopPolling()
- document.removeEventListener("visibilitychange", this.visibilityDidChange)
+ removeEventListener("visibilitychange", this.visibilityDidChange)
logger.log("ConnectionMonitor stopped")
}
}