mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 19:06:09 +00:00
buddy_list: Render view user links after filling screen.
We need to have the lists of rendered users so we can check if we should be showing the links. This commit fixes a bug where we showed the "view all subscribers" link even if all subscribers were visible on the screen.
This commit is contained in:
@@ -281,13 +281,10 @@ export class BuddyList extends BuddyListConf {
|
|||||||
// in already-sorted order.
|
// in already-sorted order.
|
||||||
this.all_user_ids = opts.all_user_ids;
|
this.all_user_ids = opts.all_user_ids;
|
||||||
|
|
||||||
$("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove();
|
|
||||||
$("#buddy-list-other-users-container .view-all-users-link").remove();
|
|
||||||
if (buddy_data.get_is_searching_users()) {
|
if (buddy_data.get_is_searching_users()) {
|
||||||
// Show all sections when searching users
|
// Show all sections when searching users
|
||||||
this.set_section_collapse(".buddy-list-section-container", false);
|
this.set_section_collapse(".buddy-list-section-container", false);
|
||||||
} else {
|
} else {
|
||||||
this.render_view_user_list_links();
|
|
||||||
this.set_section_collapse(
|
this.set_section_collapse(
|
||||||
"#buddy-list-participants-container",
|
"#buddy-list-participants-container",
|
||||||
this.participants_is_collapsed,
|
this.participants_is_collapsed,
|
||||||
@@ -314,6 +311,13 @@ export class BuddyList extends BuddyListConf {
|
|||||||
this.update_empty_list_placeholders();
|
this.update_empty_list_placeholders();
|
||||||
this.fill_screen_with_content();
|
this.fill_screen_with_content();
|
||||||
|
|
||||||
|
// This must happen after `fill_screen_with_content`
|
||||||
|
$("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove();
|
||||||
|
$("#buddy-list-other-users-container .view-all-users-link").remove();
|
||||||
|
if (!buddy_data.get_is_searching_users()) {
|
||||||
|
this.render_view_user_list_links();
|
||||||
|
}
|
||||||
|
|
||||||
// `populate` always rerenders all user rows, so we need new load handlers.
|
// `populate` always rerenders all user rows, so we need new load handlers.
|
||||||
// This logic only does something is a user has enabled the setting to
|
// This logic only does something is a user has enabled the setting to
|
||||||
// view avatars in the buddy list, and otherwise the jQuery selector will
|
// view avatars in the buddy list, and otherwise the jQuery selector will
|
||||||
|
|||||||
Reference in New Issue
Block a user