Render bookmarks list again after reconnection.

This commit is contained in:
JC Brand 2016-10-27 10:38:06 +02:00
parent 5b34ca9e37
commit 11c9670fc7

View File

@ -379,7 +379,7 @@
} }
}); });
converse.initBookmarks = function () { var initBookmarks = function () {
converse.bookmarks = new converse.Bookmarks(); converse.bookmarks = new converse.Bookmarks();
converse.bookmarks.fetchBookmarks().then(function () { converse.bookmarks.fetchBookmarks().then(function () {
converse.bookmarksview = new converse.BookmarksView( converse.bookmarksview = new converse.BookmarksView(
@ -387,8 +387,16 @@
); );
}); });
}; };
converse.on('chatBoxesFetched', converse.initBookmarks); converse.on('chatBoxesFetched', initBookmarks);
converse.on('reconnected', converse.initBookmarks);
var afterReconnection = function () {
if (_.isUndefined(converse.bookmarksview)) {
initBookmarks();
} else {
converse.bookmarksview.render();
}
};
converse.on('reconnected', afterReconnection);
} }
}); });
})); }));