Fix timing bug with minimized_chats not being available in time

This commit is contained in:
JC Brand 2016-03-14 17:20:21 +00:00
parent eff2335624
commit 49d58d321c

View File

@ -40,6 +40,13 @@
return this;
},
onConnected: function () {
converse.minimized_chats = new converse.MinimizedChats({
model: converse.chatboxes
});
this._super.onConnected.apply(this, arguments);
},
registerGlobalEventHandlers: function () {
this._super.registerGlobalEventHandlers.apply(this, arguments);
@ -352,12 +359,6 @@
}
});
var onLogin = function () {
converse.minimized_chats = new converse.MinimizedChats({
model: converse.chatboxes
});
};
converse.on('ready', onLogin);
converse.on('controlBoxOpened', function (evt, chatbox) {
// Wrapped in anon method because at scan time, chatboxviews
// attr not set yet.