hotkey: Toggle gear_menu on clicking `g` hotkey.

This commit toggles the gear_menu on pressing the `g` keyboard hotkey,
if it's already open.

Fixes: #24417.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
This commit is contained in:
Deekshith S Shetty 2023-02-23 20:51:44 +05:30 committed by Tim Abbott
parent d96048b0af
commit fc1477499b
1 changed files with 7 additions and 0 deletions

View File

@ -662,6 +662,13 @@ export function process_hotkey(e, hotkey) {
}
if (hotkey.message_view_only && gear_menu.is_open()) {
// Inside the gear menu, we don't process most hotkeys; the
// exception is that the gear_menu hotkey should toggle the
// menu closed again.
if (event_name === "gear_menu") {
gear_menu.close();
return true;
}
return false;
}