mirror of https://github.com/zulip/zulip.git
buddy_list: Move fill_screen call to the end of populate().
Sometimes we might want to re-fill the screen after collapsing or uncollapsing a section, so it's better to fill the screen just once after determining if we should collapse the "other users" section. Also, this commit removes a call to `render_section_headers()` because that's always called at the end of `fill_screen_with_content()`.
This commit is contained in:
parent
b335c19d1c
commit
d0dc33d8da
|
@ -285,15 +285,12 @@ export class BuddyList extends BuddyListConf {
|
|||
// in already-sorted order.
|
||||
this.all_user_ids = opts.all_user_ids;
|
||||
|
||||
this.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();
|
||||
}
|
||||
|
||||
this.render_section_headers();
|
||||
// Ensure the "other" section is visible when headers are collapsed,
|
||||
// because we're hiding its header so there's no way to collapse or
|
||||
// uncollapse the list in this view. Ensure we're showing/hiding as
|
||||
|
@ -302,7 +299,9 @@ export class BuddyList extends BuddyListConf {
|
|||
"#buddy-list-other-users-container",
|
||||
this.render_data.hide_headers ? false : this.other_users_is_collapsed,
|
||||
);
|
||||
|
||||
this.update_empty_list_placeholders();
|
||||
this.fill_screen_with_content();
|
||||
}
|
||||
|
||||
update_empty_list_placeholders(): void {
|
||||
|
|
|
@ -137,7 +137,6 @@ function test(label, f) {
|
|||
});
|
||||
|
||||
stub_buddy_list_elements();
|
||||
helpers.override(buddy_list, "render_section_headers", noop);
|
||||
helpers.override(buddy_list, "render_view_user_list_links", noop);
|
||||
|
||||
presence.presence_info.set(alice.user_id, {status: "active"});
|
||||
|
|
Loading…
Reference in New Issue