message_list_view: Don't mark message as read after re-render.

When selecting a previously selected message after a re-render,
we don't need to mark it as read. This caused a bug where
user cannot mark the selected message in a narrow as unread.

Also, added an additional check to only select messages if the
message is re-rendered in the currently visible message list since
you cannot select a message in a view which is not visible.
This commit is contained in:
Aman Agrawal
2023-04-21 02:07:07 +00:00
committed by Tim Abbott
parent e68a69e91f
commit c99c71a9a5

View File

@@ -1250,8 +1250,9 @@ export class MessageListView {
this._post_process($rendered_msg);
$row.replaceWith($rendered_msg);
if (was_selected) {
this.list.select_id(message_container.msg.id);
// If this list not currently displayed, we don't need to select the message.
if (was_selected && this.list === message_lists.current) {
this.list.reselect_selected_id(message_container.msg.id);
}
}