Commit 25e570c7 authored by JC Brand's avatar JC Brand

Bugfix. `connection.reset` should only be called after disconnected

parent 8cdadca4
...@@ -404,13 +404,13 @@ ...@@ -404,13 +404,13 @@
); );
converse.connection.reconnecting = true; converse.connection.reconnecting = true;
converse.connection.disconnect('re-connecting'); converse.connection.disconnect('re-connecting');
converse.connection.reset();
converse._tearDown(); converse._tearDown();
converse.logIn(null, true); converse.logIn(null, true);
}, 1000, {'leading': true}); }, 1000);
this.disconnect = function () { this.disconnect = function () {
delete converse.connection.reconnecting; delete converse.connection.reconnecting;
converse.connection.reset();
converse._tearDown(); converse._tearDown();
converse.chatboxviews.closeAllChatBoxes(); converse.chatboxviews.closeAllChatBoxes();
converse.emit('disconnected'); converse.emit('disconnected');
...@@ -544,7 +544,6 @@ ...@@ -544,7 +544,6 @@
converse.disconnection_cause = converse.LOGOUT; converse.disconnection_cause = converse.LOGOUT;
if (typeof converse.connection !== 'undefined') { if (typeof converse.connection !== 'undefined') {
converse.connection.disconnect(); converse.connection.disconnect();
converse.connection.reset();
} }
converse.clearSession(); converse.clearSession();
converse._tearDown(); converse._tearDown();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment