Commit 0cf99037 authored by JC Brand's avatar JC Brand

Fix failing tests.

parent 9510bdc1
...@@ -303,7 +303,7 @@ ...@@ -303,7 +303,7 @@
close: function (ev) { close: function (ev) {
if (ev && ev.preventDefault) { ev.preventDefault(); } if (ev && ev.preventDefault) { ev.preventDefault(); }
if (converse.connection.connected) { if (converse.connection.connected && !converse.connection.disconnecting) {
this.model.save({'closed': true}); this.model.save({'closed': true});
} else { } else {
this.model.trigger('hide'); this.model.trigger('hide');
......
...@@ -140,6 +140,7 @@ ...@@ -140,6 +140,7 @@
// out or disconnecting in the previous session. // out or disconnecting in the previous session.
// This happens in tests. // This happens in tests.
// We therefore first clean up. // We therefore first clean up.
converse.connection.reset();
converse._tearDown(); converse._tearDown();
} }
...@@ -541,11 +542,11 @@ ...@@ -541,11 +542,11 @@
}; };
this.logOut = function () { this.logOut = function () {
converse.chatboxviews.closeAllChatBoxes();
converse.setDisconnectionCause(converse.LOGOUT, undefined, true); converse.setDisconnectionCause(converse.LOGOUT, undefined, true);
if (typeof converse.connection !== 'undefined') { if (typeof converse.connection !== 'undefined') {
converse.connection.disconnect(); converse.connection.disconnect();
} }
converse.chatboxviews.closeAllChatBoxes();
converse.clearSession(); converse.clearSession();
converse._tearDown(); converse._tearDown();
converse.emit('logout'); converse.emit('logout');
......
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