From 3a2fbfc2fdb79f2790c3eab0225d17467fa9bae0 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Tue, 10 Oct 2023 18:00:37 +0000 Subject: [PATCH] inbox_ui: Fix mute / unmute not working. This is fix for the old version of mute / unmute buttons. Code borrowed from click_handlers. --- web/src/inbox_ui.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) 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, + ); + }); }