diff --git a/web/src/inbox_ui.js b/web/src/inbox_ui.js index fa9affe990..e8f68ef571 100644 --- a/web/src/inbox_ui.js +++ b/web/src/inbox_ui.js @@ -1309,4 +1309,40 @@ export function initialize() { current_focus_id = INBOX_SEARCH_ID; compose_closed_ui.set_standard_text_for_reply_button(); }); + + // Mute topic in a unmuted stream + $("body").on("click", "#inbox-list .stream_unmuted.on_hover_topic_mute", (e) => { + e.stopPropagation(); + user_topics.set_visibility_policy_for_element( + $(e.target), + user_topics.all_visibility_policies.MUTED, + ); + }); + + // Unmute topic in a unmuted stream + $("body").on("click", "#inbox-list .stream_unmuted.on_hover_topic_unmute", (e) => { + e.stopPropagation(); + user_topics.set_visibility_policy_for_element( + $(e.target), + user_topics.all_visibility_policies.INHERIT, + ); + }); + + // Unmute topic in a muted stream + $("body").on("click", "#inbox-list .stream_muted.on_hover_topic_unmute", (e) => { + e.stopPropagation(); + user_topics.set_visibility_policy_for_element( + $(e.target), + user_topics.all_visibility_policies.UNMUTED, + ); + }); + + // Mute topic in a muted stream + $("body").on("click", "#inbox-list .stream_muted.on_hover_topic_mute", (e) => { + e.stopPropagation(); + user_topics.set_visibility_policy_for_element( + $(e.target), + user_topics.all_visibility_policies.INHERIT, + ); + }); }