narrow: Explicitly resume the reading state when `narrow.deactivate`.

Previously, when a user marks messages as unread in the all messages view
then enters another view and finally back to the all messages view, they'd
notice that the reading state in all messages view is still paused. 

This happened uniquely for "All messages" because we only resumed the "reading"
state in `narrow.activate` (and generally that would generate a new MessageList anyway); 
but `message_lists.home` is a singleton, so the "no longer reading" state would remain
attached to that object forever.

Fix this by explicitly resuming the reading state when we enter all messages
view/message_lists via narrow.deactivate.
This commit is contained in:
Joseph Ho 2023-04-24 12:56:04 -04:00 committed by GitHub
parent af24279aea
commit 942cfa7118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -1064,6 +1064,7 @@ export function deactivate(coming_from_recent_topics = false) {
$("#zfilt").removeClass("focused_table");
$("#zhome").addClass("focused_table");
message_lists.set_current(message_lists.home);
message_lists.current.resume_reading();
condense.condense_and_collapse($("#zhome div.message_row"));
reset_ui_state();