Only use web socket channel if web socket connection is already established.
This commit is contained in:
parent
ec55c81302
commit
0fbb5f8ec6
3 changed files with 12 additions and 11 deletions
|
@ -49,7 +49,7 @@ class App._CollectionSingletonBase
|
|||
delete @callbacks[counter]
|
||||
|
||||
fetch: =>
|
||||
if App.WebSocket.support()
|
||||
if App.WebSocket.support() && App.WebSocket.channel()
|
||||
App.WebSocket.send(event: @event)
|
||||
return
|
||||
|
||||
|
|
|
@ -33,20 +33,20 @@ class _Singleton
|
|||
delete @callbacks[counter]
|
||||
|
||||
fetch: (view) =>
|
||||
if App.WebSocket.support()
|
||||
App.WebSocket.send(
|
||||
event: 'ticket_overview_list'
|
||||
view: view
|
||||
)
|
||||
return
|
||||
#if App.WebSocket.support() && App.WebSocket.channel()
|
||||
# App.WebSocket.send(
|
||||
# event: 'ticket_overview_list'
|
||||
# view: view
|
||||
# )
|
||||
# return
|
||||
|
||||
App.OverviewIndexCollection.fetch()
|
||||
return if @fetchActive[view]
|
||||
@fetchActive[view] = true
|
||||
App.Ajax.request(
|
||||
id: 'ticket_overview_' + view
|
||||
type: 'GET',
|
||||
url: App.Config.get('api_path') + '/ticket_overviews',
|
||||
id: "ticket_overview_#{view}"
|
||||
type: 'GET'
|
||||
url: "#{App.Config.get('api_path')}/ticket_overviews"
|
||||
data:
|
||||
view: view
|
||||
processData: true,
|
||||
|
|
|
@ -106,7 +106,8 @@ class _webSocketSingleton extends App.Controller
|
|||
)
|
||||
|
||||
channel: ->
|
||||
@backend
|
||||
return @backend if @connectionEstablished
|
||||
undefined
|
||||
|
||||
support: ->
|
||||
@supported
|
||||
|
|
Loading…
Reference in a new issue