diff --git a/clientapp/helpers/xmppEventHandlers.js b/clientapp/helpers/xmppEventHandlers.js index 1348606..3faa5fe 100644 --- a/clientapp/helpers/xmppEventHandlers.js +++ b/clientapp/helpers/xmppEventHandlers.js @@ -78,8 +78,11 @@ module.exports = function (client, app) { }); }); - client.on('disconnected', function () { + client.on('disconnected', function (err) { me.connected = false; + if (err) { + console.error(err); + } if (!app.hasConnected) { window.location = '/login'; } diff --git a/clientapp/libraries/stanza.io.js b/clientapp/libraries/stanza.io.js index cd26bdb..5e1ac2b 100644 --- a/clientapp/libraries/stanza.io.js +++ b/clientapp/libraries/stanza.io.js @@ -5098,12 +5098,12 @@ WSConnection.prototype.connect = function (opts) { self.conn = new WebSocket(opts.wsURL, 'xmpp'); self.conn.onerror = function (e) { e.preventDefault(); - self.emit('disconnected', self); + self.emit('disconnected', e); return false; }; self.conn.onclose = function () { - self.emit('disconnected', self); + self.emit('disconnected'); }; self.conn.onopen = function () {