From 5b64500da36c3ccf8283365008b14e7f0dd687da Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 22 Apr 2013 19:19:46 +0000 Subject: [PATCH] switch loading of config file to synchronous to prevent socket server from opening pre-emptively --- public/src/app.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index 39563edad8..844fa9ef6b 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -3,13 +3,18 @@ var socket, (function() { - $.get('config.json?v=' + new Date().getTime(), function(data) { - config = data; - socket = io.connect('http://' + config.socket.address + config.socket.port? ':' + config.socket.port : ''); + $.ajax({ + url: 'config.json?v=' + new Date().getTime(), + success: function(data) { + config = data; + socket = io.connect('http://' + config.socket.address + config.socket.port? ':' + config.socket.port : ''); + + socket.on('event:connect', function(data) { + + }); + }, + async: false - socket.on('event:connect', function(data) { - - }); });