Commit b339f99c authored by JC Brand's avatar JC Brand

minimize: Call `initMinimizedChats` earlier

We don't need to wait until we have the user JID given that this is just
a view being instantiated.
parent 05243524
...@@ -569,7 +569,7 @@ converse.plugins.add('converse-minimize', { ...@@ -569,7 +569,7 @@ converse.plugins.add('converse-minimize', {
function initMinimizedChats () { function initMinimizedChats () {
_converse.minimized_chats = new _converse.MinimizedChats({model: _converse.chatboxes}); _converse.minimized_chats = new _converse.MinimizedChats({model: _converse.chatboxes});
/** /**
* Triggered once the _converse.MinimizedChats instance has been * initialized * Triggered once the _converse.MinimizedChats instance has been initialized
* @event _converse#minimizedChatsInitialized * @event _converse#minimizedChatsInitialized
* @example _converse.api.listen.on('minimizedChatsInitialized', () => { ... }); * @example _converse.api.listen.on('minimizedChatsInitialized', () => { ... });
*/ */
...@@ -577,7 +577,7 @@ converse.plugins.add('converse-minimize', { ...@@ -577,7 +577,7 @@ converse.plugins.add('converse-minimize', {
} }
/************************ BEGIN Event Handlers ************************/ /************************ BEGIN Event Handlers ************************/
_converse.api.listen.on('userSessionInitialized', () => initMinimizedChats()); _converse.api.listen.on('chatBoxViewsInitialized', () => initMinimizedChats());
_converse.api.listen.on('chatBoxInsertedIntoDOM', view => _converse.chatboxviews.trimChats(view)); _converse.api.listen.on('chatBoxInsertedIntoDOM', view => _converse.chatboxviews.trimChats(view));
_converse.api.listen.on('controlBoxOpened', view => _converse.chatboxviews.trimChats(view)); _converse.api.listen.on('controlBoxOpened', view => _converse.chatboxviews.trimChats(view));
......
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