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

roomslist: Less confusing code by using promises

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