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

roomslist: Less confusing code by using promises

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