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:
evykassirer 2024-10-28 16:54:40 -07:00 committed by Tim Abbott
parent b335c19d1c
commit d0dc33d8da
2 changed files with 2 additions and 4 deletions

View File

@ -285,15 +285,12 @@ 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;
this.fill_screen_with_content();
$("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove(); $("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove();
$("#buddy-list-other-users-container .view-all-users-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()) {
this.render_view_user_list_links(); this.render_view_user_list_links();
} }
this.render_section_headers();
// Ensure the "other" section is visible when headers are collapsed, // Ensure the "other" section is visible when headers are collapsed,
// because we're hiding its header so there's no way to collapse or // 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 // 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", "#buddy-list-other-users-container",
this.render_data.hide_headers ? false : this.other_users_is_collapsed, this.render_data.hide_headers ? false : this.other_users_is_collapsed,
); );
this.update_empty_list_placeholders(); this.update_empty_list_placeholders();
this.fill_screen_with_content();
} }
update_empty_list_placeholders(): void { update_empty_list_placeholders(): void {

View File

@ -137,7 +137,6 @@ function test(label, f) {
}); });
stub_buddy_list_elements(); stub_buddy_list_elements();
helpers.override(buddy_list, "render_section_headers", noop);
helpers.override(buddy_list, "render_view_user_list_links", noop); helpers.override(buddy_list, "render_view_user_list_links", noop);
presence.presence_info.set(alice.user_id, {status: "active"}); presence.presence_info.set(alice.user_id, {status: "active"});