Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

pm_list: Rename handle_narrow_deactivated.

Tim Abbott3d804ef1860d
diff --git a/web/src/narrow.js b/web/src/narrow.js
index af670451805..cd518d816ea 100644
--- a/web/src/narrow.js
+++ b/web/src/narrow.js
@@ -559,9 +559,6 @@ export function activate(raw_operators, opts) {
compose_actions.on_narrow(opts);
- const current_filter = narrow_state.filter();
-
- pm_list.handle_narrow_activated(current_filter);
unread_ui.update_unread_banner();
// It is important to call this after other important updates
@@ -1021,6 +1018,7 @@ function handle_post_view_change(msg_list) {
update_narrow_title(filter);
left_sidebar_navigation_area.handle_narrow_activated(filter);
stream_list.handle_narrow_activated(filter);
+ pm_list.handle_narrow_activated(filter);
}
function handle_post_narrow_deactivate_processes(msg_list) {
@@ -1028,7 +1026,6 @@ function handle_post_narrow_deactivate_processes(msg_list) {
compose_fade.update_message_list();
- pm_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);
diff --git a/web/src/pm_list.js b/web/src/pm_list.js
index df6acaf74f8..648e3569f64 100644
--- a/web/src/pm_list.js
+++ b/web/src/pm_list.js
@@ -170,7 +170,7 @@ export function handle_narrow_activated(filter) {
}
}
-export function handle_narrow_deactivated() {
+export function handle_message_view_deactivated() {
// Since one can renarrow via the keyboard shortcut or similar, we
// avoid disturbing the zoomed state here.
unhighlight_all_private_messages_view();
diff --git a/web/src/views_util.js b/web/src/views_util.js
index 9da1bc54c52..2f6193cfa67 100644
--- a/web/src/views_util.js
+++ b/web/src/views_util.js
@@ -24,6 +24,7 @@ export function show(opts) {
// Hide selected elements in the left sidebar.
opts.highlight_view_in_left_sidebar();
stream_list.handle_message_view_deactivated();
+ pm_list.handle_message_view_deactivated();
// Hide "middle-column" which has html for rendering
// a messages narrow. We hide it and show the view.
@@ -37,7 +38,6 @@ export function show(opts) {
narrow.update_narrow_title(narrow_state.filter());
message_view_header.render_title_area();
narrow.handle_middle_pane_transition();
- pm_list.handle_narrow_deactivated();
search.clear_search_form();
opts.complete_rerender();
resize.update_recent_view_filters_height();
diff --git a/web/tests/recent_view.test.js b/web/tests/recent_view.test.js
index 80ec85ca50f..d93e44b908c 100644
--- a/web/tests/recent_view.test.js
+++ b/web/tests/recent_view.test.js
@@ -149,7 +149,7 @@ const narrow = mock_esm("../src/narrow", {
});
mock_esm("../src/pm_list", {
update_private_messages: noop,
- handle_narrow_deactivated: noop,
+ handle_message_view_deactivated: noop,
});
mock_esm("../src/recent_senders", {
get_topic_recent_senders: () => [2, 1],