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)
|
@consumer.subscriptions.notify(identifier, "received", message)
|
||||||
|
|
||||||
open: ->
|
open: ->
|
||||||
|
@disconnected = false
|
||||||
@consumer.subscriptions.reload()
|
@consumer.subscriptions.reload()
|
||||||
|
|
||||||
close: ->
|
close: ->
|
||||||
@consumer.subscriptions.notifyAll("disconnected")
|
@disconnect()
|
||||||
|
|
||||||
error: ->
|
error: ->
|
||||||
@consumer.subscriptions.notifyAll("disconnected")
|
@disconnect()
|
||||||
|
|
||||||
|
disconnect: ->
|
||||||
|
return if @disconnected
|
||||||
|
@disconnected = true
|
||||||
|
@consumer.subscriptions.notifyAll("disconnected")
|
||||||
|
|
||||||
toJSON: ->
|
toJSON: ->
|
||||||
state: @getState()
|
state: @getState()
|
||||||
|
|
Loading…
Reference in a new issue