gateway.reconnect() callback being used
authorDarren <darren@darrenwhitlen.com>
Fri, 30 Aug 2013 13:04:28 +0000 (14:04 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 1 Sep 2013 13:18:21 +0000 (14:18 +0100)
client/assets/src/models/gateway.js

index 4ff208a2a8a3a4f43899415854f70c1317f59e5b..b280294d978634443877eacbee4642244c463dde 100644 (file)
@@ -141,23 +141,7 @@ _kiwi.model.Gateway = function () {
         this.socket.close();\r
 \r
         this.socket = null;\r
-        this.connect();\r
-        return;\r
-\r
-        // To get around the allow-origin issues for requests, completely reload the\r
-        // transport source from the new server\r
-        window.io = null;\r
-\r
-        // Path to get the socket.io transport code\r
-        transport_path = _kiwi.app.kiwi_server + _kiwi.app.get('base_path') + '/transport/socket.io.js?ts='+(new Date().getTime());\r
-        $script(transport_path, function() {\r
-            if (!window.io) {\r
-                return callback('err_kiwi_server_not_found');\r
-            }\r
-\r
-            that.set('kiwi_server', _kiwi.app.kiwi_server + '/kiwi');\r
-            that.connect(callback);\r
-        });\r
+        this.connect(callback);\r
     };\r
 \r
 \r
@@ -278,6 +262,8 @@ _kiwi.model.Gateway = function () {
             password:   connection_info.password\r
         };\r
 \r
+        connection_info.options = connection_info.options || {};\r
+\r
         // A few optional parameters\r
         if (connection_info.options.encoding)\r
             server_info.encoding = connection_info.options.encoding;\r