hotkey: Fix upvote first emoji shortcut for custom emoji.

Fixes a bug introduced in #96eb49d, which broke the hotkey
for custom emoji.
This commit is contained in:
evykassirer 2025-03-13 22:25:36 -07:00 committed by Tim Abbott
parent 4029d80c01
commit 45c9747d4b

View File

@ -1229,7 +1229,9 @@ export function process_hotkey(e, hotkey) {
}
const canonical_name = emoji.get_emoji_name(first_reaction.emoji_code);
reactions.toggle_emoji_reaction(msg, canonical_name);
// `canonical_name` will be `undefined` for custom emoji, so we can default
// to the `emoji_name`.
reactions.toggle_emoji_reaction(msg, canonical_name ?? first_reaction.emoji_name);
return true;
}
case "toggle_topic_visibility_policy":