diff options
-rw-r--r-- | actioncable/app/assets/javascripts/action_cable/connection.coffee | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actioncable/app/assets/javascripts/action_cable/connection.coffee b/actioncable/app/assets/javascripts/action_cable/connection.coffee index b1343a111c..78028bda3c 100644 --- a/actioncable/app/assets/javascripts/action_cable/connection.coffee +++ b/actioncable/app/assets/javascripts/action_cable/connection.coffee @@ -16,7 +16,7 @@ class ActionCable.Connection false open: => - if @webSocket and not @isClosed() + if @isAlive() console.log("[cable] Attemped to open WebSocket, but existing socket is #{@getState()}", Date.now()) throw new Error("Existing connection must be closed before opening") else @@ -44,8 +44,8 @@ class ActionCable.Connection # Private - isClosed: -> - @isState("closing", "closed") + isAlive: -> + not @isState("closing", "closed") isState: (states...) -> @getState() in states |