mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Only send "disconnected" notification once
This commit is contained in:
parent
1379e973be
commit
ddfd649c11
1 changed files with 8 additions and 2 deletions
|
@ -47,13 +47,19 @@ class Cable.Connection
|
|||
@consumer.subscriptions.notify(identifier, "received", message)
|
||||
|
||||
open: ->
|
||||
@disconnected = false
|
||||
@consumer.subscriptions.reload()
|
||||
|
||||
close: ->
|
||||
@consumer.subscriptions.notifyAll("disconnected")
|
||||
@disconnect()
|
||||
|
||||
error: ->
|
||||
@consumer.subscriptions.notifyAll("disconnected")
|
||||
@disconnect()
|
||||
|
||||
disconnect: ->
|
||||
return if @disconnected
|
||||
@disconnected = true
|
||||
@consumer.subscriptions.notifyAll("disconnected")
|
||||
|
||||
toJSON: ->
|
||||
state: @getState()
|
||||
|
|
Loading…
Reference in a new issue