mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
message feed: Notify user when messages are not being marked as read.
Notifies user when messages are not being marked as read through a banner that lets them mark all messages in the narrow as read. Note that the banner is only displayed if the user's actions, like scrolling, would've actually marked the messages as read. This avoids distracting the user when viewing a thread they've already read. tabbott has verified that if new messages come in, the banner will reappear. Fixes: #18768.
This commit is contained in:
@@ -10,7 +10,9 @@ import * as message_viewport from "./message_viewport";
|
||||
import * as narrow_banner from "./narrow_banner";
|
||||
import * as narrow_state from "./narrow_state";
|
||||
import * as recent_topics_util from "./recent_topics_util";
|
||||
import * as unread from "./unread";
|
||||
import * as unread_ops from "./unread_ops";
|
||||
import * as unread_ui from "./unread_ui";
|
||||
|
||||
let actively_scrolling = false;
|
||||
|
||||
@@ -245,6 +247,19 @@ export function initialize() {
|
||||
}
|
||||
if (event.msg_list.can_mark_messages_read()) {
|
||||
unread_ops.notify_server_messages_read(messages, {from: "pointer"});
|
||||
} else if (
|
||||
unread.get_unread_messages(messages).length !== 0 &&
|
||||
// The below checks might seem redundant, but it's
|
||||
// possible this logic, which runs after a delay, lost
|
||||
// a race with switching to another view, like Recent
|
||||
// Topics, and we don't want to displ[ay this banner
|
||||
// in such a view.
|
||||
//
|
||||
// This can likely be fixed more cleanly with another approach.
|
||||
narrow_state.filter() !== undefined &&
|
||||
message_lists.current === event.msg_list
|
||||
) {
|
||||
unread_ui.notify_messages_remain_unread();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user