Update unread counts for streams when muting topics.

Fixes #427.
This commit is contained in:
Kartik Maji
2016-03-24 18:21:14 +05:30
committed by Tim Abbott
parent cc118824d5
commit 2b3312cd6e
3 changed files with 7 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
set_global('page_params', {
domain: 'zulip.com'
});
add_dependencies({
unread: 'js/unread.js'
});
var muting = require('js/muting.js');

View File

@@ -8,7 +8,8 @@
// dependencies (except _).
add_dependencies({
muting: 'js/muting.js'
muting: 'js/muting.js',
unread: 'js/unread.js'
});
var stream_data = require('js/stream_data.js');

View File

@@ -11,6 +11,7 @@ exports.mute_topic = function (stream, topic) {
muted_topics.set(stream, sub_dict);
}
sub_dict.set(topic, true);
unread.update_unread_counts();
};
exports.unmute_topic = function (stream, topic) {
@@ -18,6 +19,7 @@ exports.unmute_topic = function (stream, topic) {
if (sub_dict) {
sub_dict.del(topic);
}
unread.update_unread_counts();
};
exports.is_topic_muted = function (stream, topic) {