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.

recent_topics_ui: Extend check for unread to PMs.

Aman Agrawalae5be125404f
diff --git a/static/js/recent_topics_ui.js b/static/js/recent_topics_ui.js
index e761a45f3f4..0bfa688a0ef 100644
--- a/static/js/recent_topics_ui.js
+++ b/static/js/recent_topics_ui.js
@@ -812,7 +812,10 @@ function is_focus_at_last_table_row() {
function has_unread(row) {
const last_msg_id = topics_widget.get_current_list()[row].last_msg_id;
const last_msg = message_store.get(last_msg_id);
- return unread.num_unread_for_topic(last_msg.stream_id, last_msg.topic) > 0;
+ if (last_msg.type === "stream") {
+ return unread.num_unread_for_topic(last_msg.stream_id, last_msg.topic) > 0;
+ }
+ return unread.num_unread_for_user_ids_string(last_msg.to_user_ids) > 0;
}
export function focus_clicked_element(topic_row_index, col, topic_key) {