Add toggle_mute to muting_ui.js.

This commit is contained in:
Joshua Pan 2017-03-24 22:25:04 +00:00 committed by showell
parent 32837804d8
commit dc9f83005f
1 changed files with 8 additions and 0 deletions

View File

@ -156,6 +156,14 @@ exports.unmute = function (stream, topic) {
exports.set_up_muted_topics_ui(muting.get_muted_topics());
};
exports.toggle_mute = function (msg) {
if (muting.is_topic_muted(msg.stream, msg.subject)) {
exports.unmute(msg.stream, msg.subject);
} else if (msg.type === 'stream') {
exports.mute(msg.stream, msg.subject);
}
};
$(function () {
exports.update_muted_topics(page_params.muted_topics);
});