Use queue if App.Ajax now.
This commit is contained in:
parent
cb77e7999f
commit
f48fadd56b
1 changed files with 2 additions and 6 deletions
|
@ -287,11 +287,9 @@ class _webSocketSingleton extends App.Controller
|
|||
# return if init is already done and not forced
|
||||
return if @_ajaxInitDone && !data.force
|
||||
|
||||
# stop init request if new one is started
|
||||
if @_ajaxInitWorking
|
||||
@_ajaxInitWorking.abort()
|
||||
# call init request
|
||||
@_ajaxInitWorking = App.Ajax.request(
|
||||
App.Ajax.request(
|
||||
id: 'ws-login'
|
||||
type: 'POST'
|
||||
url: @Config.get('api_path') + '/message_send'
|
||||
data: JSON.stringify({ data: { action: 'login' } })
|
||||
|
@ -304,10 +302,8 @@ class _webSocketSingleton extends App.Controller
|
|||
@_ajaxReceive()
|
||||
@_ajaxSendQueue()
|
||||
@_ajaxInitDone = true
|
||||
@_ajaxInitWorking = false
|
||||
error: =>
|
||||
@_ajaxInitDone = true
|
||||
@_ajaxInitWorking = false
|
||||
|
||||
# try reconnect on error after x sec.
|
||||
reconnect = =>
|
||||
|
|
Loading…
Reference in a new issue