Use queue if App.Ajax now.

This commit is contained in:
Martin Edenhofer 2013-08-08 14:20:40 +02:00
parent cb77e7999f
commit f48fadd56b

View file

@ -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 = =>