inbox_ui: Fix mute / unmute not working.

This is fix for the old version of mute / unmute buttons.
Code borrowed from click_handlers.
This commit is contained in:
Aman Agrawal 2023-10-10 18:00:37 +00:00 committed by Tim Abbott
parent 0fd4e309d5
commit 3a2fbfc2fd
1 changed files with 36 additions and 0 deletions

View File

@ -1309,4 +1309,40 @@ export function initialize() {
current_focus_id = INBOX_SEARCH_ID; current_focus_id = INBOX_SEARCH_ID;
compose_closed_ui.set_standard_text_for_reply_button(); 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,
);
});
} }