Commit 7de76924 authored by JC Brand's avatar JC Brand

Create the minimized_chats obj during `_initialization`

and don't remove during `_tearDown`.

Fixes bug in `trimChats` when logging in again and `converse.minimized_chats`
is undefined.
parent 5ed8dfbe
...@@ -32,22 +32,12 @@ ...@@ -32,22 +32,12 @@
// //
// New functions which don't exist yet can also be added. // New functions which don't exist yet can also be added.
_tearDown: function () { _initialize: function () {
this._super._tearDown.apply(this, arguments); this._super._initialize.apply(this, arguments);
if (this.minimized_chats) {
this.minimized_chats.undelegateEvents().model.reset();
this.minimized_chats.removeAll(); // Remove sub-views
this.minimized_chats.tearDown().remove(); // Remove overview
delete this.minimized_chats;
}
return this;
},
onConnected: function () {
converse.minimized_chats = new converse.MinimizedChats({ converse.minimized_chats = new converse.MinimizedChats({
model: converse.chatboxes model: converse.chatboxes
}); });
return this._super.onConnected.apply(this, arguments); return this;
}, },
registerGlobalEventHandlers: function () { registerGlobalEventHandlers: function () {
......
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