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;
};
exports.update_topic_unread_count = function (message) {
const topic_key = message.stream_id + ":" + message.topic;
exports.inplace_rerender(topic_key);
};
exports.complete_rerender = function () {
// NOTE: This function is grows expensive with
// number of topics. Only call when necessary.