Commit bea76e5b authored by JC Brand's avatar JC Brand

Use the logout event, instead of an override

parent ee5e77e8
...@@ -35,12 +35,6 @@ ...@@ -35,12 +35,6 @@
return this.__super__.disconnect.apply(this, arguments); return this.__super__.disconnect.apply(this, arguments);
}, },
logOut: function () {
const { _converse } = this.__super__;
_converse.chatboxviews.closeAllChatBoxes();
return this.__super__.logOut.apply(this, arguments);
},
initStatus: function (reconnecting) { initStatus: function (reconnecting) {
const { _converse } = this.__super__; const { _converse } = this.__super__;
if (!reconnecting) { if (!reconnecting) {
...@@ -569,7 +563,7 @@ ...@@ -569,7 +563,7 @@
}, },
onConnected () { onConnected () {
this.browserStorage = new Backbone.BrowserStorage[_converse.storage]( this.browserStorage = new Backbone.BrowserStorage.session(
b64_sha1(`converse.chatboxes-${_converse.bare_jid}`)); b64_sha1(`converse.chatboxes-${_converse.bare_jid}`));
this.registerMessageHandler(); this.registerMessageHandler();
this.fetch({ this.fetch({
...@@ -838,6 +832,10 @@ ...@@ -838,6 +832,10 @@
delete _converse.chatboxes.browserStorage; delete _converse.chatboxes.browserStorage;
}); });
_converse.api.listen.on('logout', () => {
_converse.chatboxviews.closeAllChatBoxes();
});
_converse.api.listen.on('presencesInitialized', () => _converse.chatboxes.onConnected()); _converse.api.listen.on('presencesInitialized', () => _converse.chatboxes.onConnected());
/************************ END Event Handlers ************************/ /************************ END Event Handlers ************************/
......
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