diff options
Diffstat (limited to 'actioncable/app/javascript/action_cable/connection.js')
-rw-r--r-- | actioncable/app/javascript/action_cable/connection.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actioncable/app/javascript/action_cable/connection.js b/actioncable/app/javascript/action_cable/connection.js index b2910cb2a6..96bac132c1 100644 --- a/actioncable/app/javascript/action_cable/connection.js +++ b/actioncable/app/javascript/action_cable/connection.js @@ -44,7 +44,9 @@ class Connection { close({allowReconnect} = {allowReconnect: true}) { if (!allowReconnect) { this.monitor.stop() } - if (this.isActive()) { return (this.webSocket ? this.webSocket.close() : undefined) } + if (this.isActive()) { + return this.webSocket.close() + } } reopen() { @@ -65,7 +67,9 @@ class Connection { } getProtocol() { - return (this.webSocket ? this.webSocket.protocol : undefined) + if (this.webSocket) { + return this.webSocket.protocol + } } isOpen() { |