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]
|
delete @callbacks[counter]
|
||||||
|
|
||||||
fetch: =>
|
fetch: =>
|
||||||
if App.WebSocket.support()
|
if App.WebSocket.support() && App.WebSocket.channel()
|
||||||
App.WebSocket.send(event: @event)
|
App.WebSocket.send(event: @event)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -33,20 +33,20 @@ class _Singleton
|
||||||
delete @callbacks[counter]
|
delete @callbacks[counter]
|
||||||
|
|
||||||
fetch: (view) =>
|
fetch: (view) =>
|
||||||
if App.WebSocket.support()
|
#if App.WebSocket.support() && App.WebSocket.channel()
|
||||||
App.WebSocket.send(
|
# App.WebSocket.send(
|
||||||
event: 'ticket_overview_list'
|
# event: 'ticket_overview_list'
|
||||||
view: view
|
# view: view
|
||||||
)
|
# )
|
||||||
return
|
# return
|
||||||
|
|
||||||
App.OverviewIndexCollection.fetch()
|
App.OverviewIndexCollection.fetch()
|
||||||
return if @fetchActive[view]
|
return if @fetchActive[view]
|
||||||
@fetchActive[view] = true
|
@fetchActive[view] = true
|
||||||
App.Ajax.request(
|
App.Ajax.request(
|
||||||
id: 'ticket_overview_' + view
|
id: "ticket_overview_#{view}"
|
||||||
type: 'GET',
|
type: 'GET'
|
||||||
url: App.Config.get('api_path') + '/ticket_overviews',
|
url: "#{App.Config.get('api_path')}/ticket_overviews"
|
||||||
data:
|
data:
|
||||||
view: view
|
view: view
|
||||||
processData: true,
|
processData: true,
|
||||||
|
|
|
@ -106,7 +106,8 @@ class _webSocketSingleton extends App.Controller
|
||||||
)
|
)
|
||||||
|
|
||||||
channel: ->
|
channel: ->
|
||||||
@backend
|
return @backend if @connectionEstablished
|
||||||
|
undefined
|
||||||
|
|
||||||
support: ->
|
support: ->
|
||||||
@supported
|
@supported
|
||||||
|
|
Loading…
Reference in a new issue