From 1ee757a237dcce5a3f2939df5c16fa6a8edd0133 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Mon, 29 May 2017 15:25:35 -0600 Subject: [PATCH] Use toggle_emoji_reaction() in the emoji picker. If we know the name of the emoji you need to toggle, we can toggle_emoji_reaction(), which is less complex than toggle_reaction(). --- static/js/reactions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/reactions.js b/static/js/reactions.js index f9e151f891..70e1100e5f 100644 --- a/static/js/reactions.js +++ b/static/js/reactions.js @@ -143,7 +143,7 @@ function maybe_select_emoji(e) { if (emoji_picker.is_composition(first_emoji)) { first_emoji.click(); } else { - exports.toggle_reaction(current_msg_list.selected_id(), first_emoji.title); + exports.toggle_emoji_reaction(current_msg_list.selected_id(), first_emoji.title); } } } @@ -165,7 +165,7 @@ $(document).on('click', '.emoji-popover-emoji.reaction', function () { if (exports.current_user_has_reacted_to_emoji(message, emoji_name)) { $(this).removeClass('reacted'); } - exports.toggle_reaction(message_id, emoji_name); + exports.toggle_emoji_reaction(message_id, emoji_name); }); $(document).on('input', '.emoji-popover-filter', filter_emojis);