stream_list: Rename handle_narrow_deactivated.

It did the same thing as handle_narrow_activated when passed the
home_msg_list filter.

We still leave a renamed version for use by the inbox/recent views.
This commit is contained in:
Tim Abbott 2023-10-03 17:57:25 -07:00
parent 20b2323c67
commit 0a189119aa
6 changed files with 6 additions and 7 deletions

View File

@ -562,7 +562,6 @@ export function activate(raw_operators, opts) {
const current_filter = narrow_state.filter();
pm_list.handle_narrow_activated(current_filter);
stream_list.handle_narrow_activated(current_filter);
unread_ui.update_unread_banner();
// It is important to call this after other important updates
@ -1021,6 +1020,7 @@ function handle_post_view_change(msg_list) {
message_view_header.render_title_area();
update_narrow_title(filter);
left_sidebar_navigation_area.handle_narrow_activated(filter);
stream_list.handle_narrow_activated(filter);
}
function handle_post_narrow_deactivate_processes(msg_list) {
@ -1029,7 +1029,6 @@ function handle_post_narrow_deactivate_processes(msg_list) {
compose_fade.update_message_list();
pm_list.handle_narrow_deactivated();
stream_list.handle_narrow_deactivated();
message_edit.handle_narrow_deactivated();
widgetize.set_widgets_for_list();
message_feed_top_notices.update_top_of_narrow_notices(msg_list);

View File

@ -666,7 +666,7 @@ export function handle_narrow_activated(filter) {
}
}
export function handle_narrow_deactivated() {
export function handle_message_view_deactivated() {
deselect_stream_items();
topic_zoom.clear_topics();
}

View File

@ -23,7 +23,7 @@ export function show(opts) {
// Hide selected elements in the left sidebar.
opts.highlight_view_in_left_sidebar();
stream_list.handle_narrow_deactivated();
stream_list.handle_message_view_deactivated();
// Hide "middle-column" which has html for rendering
// a messages narrow. We hide it and show the view.

View File

@ -195,8 +195,8 @@ run_test("basics", ({override}) => {
[message_view_header, "render_title_area"],
[notifications, "redraw_title"],
[left_sidebar_navigation_area, "handle_narrow_activated"],
[compose_actions, "on_narrow"],
[stream_list, "handle_narrow_activated"],
[compose_actions, "on_narrow"],
[compose_recipient, "update_narrow_to_recipient_visibility"],
]);

View File

@ -166,7 +166,7 @@ mock_esm("../src/stream_data", {
get_stream_name_from_id: () => "stream_name",
});
mock_esm("../src/stream_list", {
handle_narrow_deactivated: noop,
handle_message_view_deactivated: noop,
});
mock_esm("../src/timerender", {
relative_time_string_from_date: () => "Just now",

View File

@ -458,7 +458,7 @@ test_ui("narrowing", ({mock_template}) => {
topics_closed = true;
};
stream_list.handle_narrow_deactivated();
stream_list.handle_message_view_deactivated();
assert.equal(removed_classes, "active-filter stream-expanded");
assert.ok(topics_closed);
});