views: Fix message_list.current not updating to undefined on narrow.

Earlier when users narrowed to recents or inbox, message_list.current
was updating to last dm row selected for first few filter checks in
'narrow_state' which in turn would set active_user_ids to last dm
row selected. This resulted in DM highlight lingering.
The narrow_state.filter is supposed to return undefined when narrowed
to recents or inbox.

This commit fixes the behaviour by setting 'current' undefined before
filter checks on narrow.

Fixes part of #27698.
This commit is contained in:
Pratik Chanda 2024-03-26 00:20:59 +05:30 committed by Tim Abbott
parent da80afd6f4
commit 8c89725fcc
1 changed files with 5 additions and 5 deletions

View File

@ -69,11 +69,6 @@ export function show(opts) {
return;
}
// 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.
$("#message_feed_container").hide();
@ -81,6 +76,11 @@ export function show(opts) {
message_lists.update_current_message_list(undefined);
opts.set_visible(true);
// 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();
unread_ui.hide_unread_banner();
opts.update_compose();
narrow_title.update_narrow_title(narrow_state.filter());