From eb2acc926f09f566b1473f4c2721a12d7f0cb62c Mon Sep 17 00:00:00 2001 From: Darren Date: Sun, 29 Dec 2013 20:31:29 +0000 Subject: [PATCH] Second IRC connection via /server fix --- client/src/models/newconnection.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/client/src/models/newconnection.js b/client/src/models/newconnection.js index 9899c92..8d1b558 100644 --- a/client/src/models/newconnection.js +++ b/client/src/models/newconnection.js @@ -14,11 +14,16 @@ _kiwi.model.NewConnection = Backbone.Collection.extend({ this.view.networkConnecting(); - - _kiwi.gateway.set('kiwi_server', _kiwi.app.kiwi_server); - _kiwi.gateway.connect(function() { - that.makeConnection(new_connection_event); - }); + // If not connected already, connect then send the IRC connect info + if (!_kiwi.gateway.isConnected()) { + _kiwi.gateway.set('kiwi_server', _kiwi.app.kiwi_server); + _kiwi.gateway.connect(function() { + that.makeConnection(new_connection_event); + }); + + } else { + this.makeConnection(new_connection_event); + } }, -- 2.25.1