Merge pull request #387 from gbonvehi/fix-unload-clearSession

Fixed an error that appears when unload event is triggered
This commit is contained in:
JC Brand 2015-05-08 10:55:29 +02:00
commit 1cf8cfc9f6
2 changed files with 7 additions and 3 deletions

View File

@ -569,10 +569,13 @@
};
this.clearSession = function () {
this.roster.browserStorage._clear();
if (this.roster) {
this.roster.browserStorage._clear();
}
this.session.browserStorage._clear();
var controlbox = converse.chatboxes.get('controlbox');
controlbox.save({'connected': false});
if (converse.connection.connected) {
converse.chatboxes.get('controlbox').save({'connected': false});
}
};
this.setSession = function () {

View File

@ -6,6 +6,7 @@ Changelog
* Refactored in order to remove the strophe.roster.js dependency. [jcbrand]
* Bugfix. Manual login doesn't work when only websocket_url is set and not bosh_service_url. [jcbrand]
* Bugfix. clearSessions during unload event would throw an error when not logged in. [gbonvehi]
0.9.3 (2015-05-01)
------------------