Commit 11c9670f authored by JC Brand's avatar JC Brand

Render bookmarks list again after reconnection.

parent 5b34ca9e
...@@ -379,7 +379,7 @@ ...@@ -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 @@ ...@@ -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);
} }
}); });
})); }));
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