aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/app
diff options
context:
space:
mode:
authorRichard Macklin <richard.github@nrm.com>2018-12-01 14:48:24 -0800
committerRichard Macklin <richard.github@nrm.com>2018-12-01 14:49:43 -0800
commit2bb4fdef5efc70327c018e982ff809a29ac6708b (patch)
tree51bf25fefd24540a84bb8b27c31e02123e58881c /actioncable/app
parentaa1ba9cb244b1e03d36aaa941ae4e91c6713b77e (diff)
downloadrails-2bb4fdef5efc70327c018e982ff809a29ac6708b.tar.gz
rails-2bb4fdef5efc70327c018e982ff809a29ac6708b.tar.bz2
rails-2bb4fdef5efc70327c018e982ff809a29ac6708b.zip
Replace reference to WebSocket global with ActionCable.adapters.WebSocket
The WebSocket dependency of ActionCable.Connection was made configurable in 66901c1849efae74c8a58fe0cb36afd487c067cc However, the reference here in Connection#getState was not updated to use the configurable property. This change remedies that and adds a test to verify it. Additionally, it backfills a test to ensure that Connection#open uses the configurable property.
Diffstat (limited to 'actioncable/app')
-rw-r--r--actioncable/app/assets/javascripts/action_cable.js4
-rw-r--r--actioncable/app/javascript/action_cable/connection.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/actioncable/app/assets/javascripts/action_cable.js b/actioncable/app/assets/javascripts/action_cable.js
index 90e8e6b99b..ee11c62eb6 100644
--- a/actioncable/app/assets/javascripts/action_cable.js
+++ b/actioncable/app/assets/javascripts/action_cable.js
@@ -224,8 +224,8 @@
};
Connection.prototype.getState = function getState() {
if (this.webSocket) {
- for (var state in WebSocket) {
- if (WebSocket[state] === this.webSocket.readyState) {
+ for (var state in adapters.WebSocket) {
+ if (adapters.WebSocket[state] === this.webSocket.readyState) {
return state.toLowerCase();
}
}
diff --git a/actioncable/app/javascript/action_cable/connection.js b/actioncable/app/javascript/action_cable/connection.js
index e3ff8bde24..8aa4fe1266 100644
--- a/actioncable/app/javascript/action_cable/connection.js
+++ b/actioncable/app/javascript/action_cable/connection.js
@@ -88,8 +88,8 @@ class Connection {
getState() {
if (this.webSocket) {
- for (let state in WebSocket) {
- if (WebSocket[state] === this.webSocket.readyState) {
+ for (let state in adapters.WebSocket) {
+ if (adapters.WebSocket[state] === this.webSocket.readyState) {
return state.toLowerCase()
}
}