Bugfix. Login form wasn't rendered after logging out

when `auto_reconnect` is set to true.
This commit is contained in:
JC Brand 2017-01-31 19:29:47 +00:00
parent 1fb6ad7310
commit 8cdadca492
2 changed files with 16 additions and 14 deletions

View File

@ -1,12 +1,13 @@
# Changelog # Changelog
## 2.0.5 ## 2.0.5 (Unreleased)
- #743, #751, #753 Update to Strophe 1.2.12. SASL-EXTERNAL now has reduced priority, so it won't - #743, #751, #753 Update to Strophe 1.2.12. SASL-EXTERNAL now has reduced priority, so it won't
be prioritized above other auth mechanisms. [jcbrand] be prioritized above other auth mechanisms. [jcbrand]
- #755: create composer.json to add this project in packagist.org [fabiomontefuscolo] - #755: create composer.json to add this project in packagist.org [fabiomontefuscolo]
- #758: Bugfix. Render all resize drag handles for ChatRoomView. [LeoYReyes] - #758: Bugfix. Render all resize drag handles for ChatRoomView. [LeoYReyes]
- Bugfix. Cancel button shown while registration form is being fetched wasn't working - Bugfix. Cancel button shown while registration form is being fetched wasn't working
properly. [jcbrand] properly. [jcbrand]
- Bugfix. Login form wasn't rendered after logging out (when `auto_reconnect` is `true`). [jcbrand]
## 2.0.4 (2016-12-13) ## 2.0.4 (2016-12-13)
- #737: Bugfix. Translations weren't being applied. [jcbrand] - #737: Bugfix. Translations weren't being applied. [jcbrand]

View File

@ -407,7 +407,7 @@
converse.connection.reset(); converse.connection.reset();
converse._tearDown(); converse._tearDown();
converse.logIn(null, true); converse.logIn(null, true);
}, 1000); }, 1000, {'leading': true});
this.disconnect = function () { this.disconnect = function () {
delete converse.connection.reconnecting; delete converse.connection.reconnecting;
@ -419,7 +419,10 @@
}; };
this.onDisconnected = function (condition) { this.onDisconnected = function (condition) {
if (converse.disconnection_cause !== converse.LOGOUT && converse.auto_reconnect) { if (_.includes([converse.LOGOUT, Strophe.Status.AUTHFAIL], converse.disconnection_cause) ||
!converse.auto_reconnect) {
return this.disconnect();
}
if (converse.disconnection_cause === Strophe.Status.CONNFAIL) { if (converse.disconnection_cause === Strophe.Status.CONNFAIL) {
converse.reconnect(condition); converse.reconnect(condition);
converse.log('RECONNECTING'); converse.log('RECONNECTING');
@ -430,8 +433,6 @@
} }
converse.emit('reconnecting'); converse.emit('reconnecting');
return 'reconnecting'; return 'reconnecting';
}
return this.disconnect();
}; };
this.setDisconnectionCause = function (connection_status) { this.setDisconnectionCause = function (connection_status) {