hotkey: Avoid checking message_lists.current for `narrow_private`.

Since `narrow_private` doesn't need a message for the hotkey to
work, there is no need to call do_narrow_actions which needs a
selected message id.
This commit is contained in:
Aman Agrawal 2024-02-24 06:25:21 +00:00 committed by Tim Abbott
parent de0db7ad1a
commit 861acb9abd
1 changed files with 2 additions and 3 deletions

View File

@ -929,9 +929,8 @@ export function process_hotkey(e, hotkey) {
// Shortcuts that don't require a message // Shortcuts that don't require a message
switch (event_name) { switch (event_name) {
case "narrow_private": case "narrow_private":
return do_narrow_action((_target, opts) => { narrow.by("is", "dm", {trigger: "hotkey"});
narrow.by("is", "dm", opts); return true;
});
case "query_streams": case "query_streams":
stream_list.initiate_search(); stream_list.initiate_search();
return true; return true;