Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

hotkey: Merge uses of `M` hotkey.

Aman Agrawal93c4dcbdc9c7
diff --git a/web/src/hotkey.js b/web/src/hotkey.js
index a9712b679b5..7d414add2ab 100644
--- a/web/src/hotkey.js
+++ b/web/src/hotkey.js
@@ -1160,11 +1160,17 @@ export function process_hotkey(e, hotkey) {
user_topics_ui.toggle_topic_visibility_policy(recent_msg);
return true;
}
- return false;
}
if (inbox_ui.is_in_focus()) {
return inbox_ui.toggle_topic_visibility_policy();
}
+ if (message_lists.current.selected_message()) {
+ user_topics_ui.toggle_topic_visibility_policy(
+ message_lists.current.selected_message(),
+ );
+ return true;
+ }
+ return false;
}
// Shortcuts that are useful with an empty message feed, like opening compose.
@@ -1337,9 +1343,6 @@ export function process_hotkey(e, hotkey) {
reactions.toggle_emoji_reaction(msg, canonical_name ?? first_reaction.emoji_name);
return true;
}
- case "toggle_topic_visibility_policy":
- user_topics_ui.toggle_topic_visibility_policy(msg);
- return true;
case "toggle_message_collapse":
condense.toggle_collapse(msg);
return true;
diff --git a/web/tests/hotkey.test.cjs b/web/tests/hotkey.test.cjs
index acdca24bd00..3f873687de7 100644
--- a/web/tests/hotkey.test.cjs
+++ b/web/tests/hotkey.test.cjs
@@ -439,7 +439,7 @@ run_test("modal open", ({override}) => {
test_while_not_editing_text("misc", ({override}) => {
// Next, test keys that only work on a selected message.
- const message_view_only_keys = "@+>RjJkKsuvVi:GMH";
+ const message_view_only_keys = "@+>RjJkKsuvVi:GH";
// Check that they do nothing without a selected message
with_overrides(({override}) => {