Browse Source

Use queue if App.Ajax now.

Martin Edenhofer 11 years ago
parent
commit
f48fadd56b
1 changed files with 2 additions and 6 deletions
  1. 2 6
      app/assets/javascripts/app/lib/app_post/websocket.js.coffee

+ 2 - 6
app/assets/javascripts/app/lib/app_post/websocket.js.coffee

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