recent_topics: Update unread count of topics inplace.

This commit is contained in:
Aman Agrawal
2020-05-22 20:41:19 +05:30
committed by Tim Abbott
parent 52529107d2
commit 3c5adeee8a
2 changed files with 6 additions and 0 deletions

View File

@@ -152,6 +152,11 @@ exports.update_topic_is_muted = function (stream_id, topic, is_muted) {
return true; return true;
}; };
exports.update_topic_unread_count = function (message) {
const topic_key = message.stream_id + ":" + message.topic;
exports.inplace_rerender(topic_key);
};
exports.complete_rerender = function () { exports.complete_rerender = function () {
// NOTE: This function is grows expensive with // NOTE: This function is grows expensive with
// number of topics. Only call when necessary. // number of topics. Only call when necessary.

View File

@@ -15,6 +15,7 @@ function process_newly_read_message(message, options) {
message_list.narrowed.show_message_as_read(message, options); message_list.narrowed.show_message_as_read(message, options);
} }
notifications.close_notification(message); notifications.close_notification(message);
recent_topics.update_topic_unread_count(message);
} }
exports.process_read_messages_event = function (message_ids) { exports.process_read_messages_event = function (message_ids) {