emoji_picker: Add expectOne to emoji_picker.navigate.

There is apparently some way to have two instances
of `.emoji-popover-emoji-map`, although I can't
reproduce it.

This causes an `expectOne` check to fail fairly
deep in the stack.

Now we report it more directly.

This commit and a few previous ones mostly
address #15348 by trying to either a) not
depending on having a single instance of
the popover or b) making it more explicit
in cases where do expect that invariant.

Fixes #15348
This commit is contained in:
Steve Howell 2020-06-18 18:52:25 +00:00 committed by Tim Abbott
parent 91dec2729f
commit 9423d150ac
1 changed files with 2 additions and 1 deletions

View File

@ -390,7 +390,8 @@ exports.navigate = function (event_name) {
return; return;
} }
const $emoji_map = $(".emoji-popover-emoji-map"); const $popover = $(".emoji-popover").expectOne();
const $emoji_map = $popover.find(".emoji-popover-emoji-map").expectOne();
const selected_emoji = get_rendered_emoji(current_section, current_index); const selected_emoji = get_rendered_emoji(current_section, current_index);
const is_filter_focused = $('.emoji-popover-filter').is(':focus'); const is_filter_focused = $('.emoji-popover-filter').is(':focus');