Commit 6e67bdfd authored by JC Brand's avatar JC Brand

roomslist: Less confusing code by using promises

parent 5ab16931
...@@ -163,12 +163,15 @@ ...@@ -163,12 +163,15 @@
{'model': _converse.chatboxes} {'model': _converse.chatboxes}
); );
}; };
_converse.on('bookmarksInitialized', initRoomsListView);
_converse.on('roomsPanelRendered', function () { $.when(_converse.api.waitUntil('chatBoxesFetched'),
_converse.api.waitUntil('roomsPanelRendered')).then(
function () {
if (_converse.allow_bookmarks) { if (_converse.allow_bookmarks) {
return; _converse.api.waitUntil('bookmarksInitialized').then(initRoomsListView);
} } else {
initRoomsListView(); initRoomsListView();
}
}); });
var afterReconnection = function () { var afterReconnection = 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