Skip to content

Commit b641016

Browse files
committed
emoji [nfc]: Use shared code for match-literal-emoji logic
@zulip/shared implemented this in zulip/zulip@21778, and it was released (with a needed Flow-type fix) in 0.0.16, which we just upgraded to in the previous commit. From reading code, I believe this doesn't change the emoji-matcher behavior that we offer to the user, so marking NFC.
1 parent 3297b18 commit b641016

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/emoji/data.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ export const getFilteredEmojis = (
166166
const allMatchingEmoji: Map<string, EmojiForShared> = new Map();
167167

168168
for (const emoji of getUnicodeEmojiObjectsMemoized(serverEmojiData)) {
169-
// TODO(shared): Use shared version of this feature too, once it exists.
170-
// See PR: https://github.com/zulip/zulip/pull/21778
171-
// and issue: https://github.com/zulip/zulip/issues/21714
172-
// This logic does not do any special handling for things like
169+
// `matcher`'s match-literal-emoji logic doesn't do special handling for
173170
// skin-tone modifiers or gender modifiers, since Zulip does not
174171
// currently support those: https://github.com/zulip/zulip/issues/992.
175172
// Once support is added for that, we may want to come back here and
@@ -180,9 +177,7 @@ export const getFilteredEmojis = (
180177
// better to not show the user anything if they've searched for an
181178
// emoji with a modifier than it is to show them the non-modified
182179
// emoji, hence the very simple matching.
183-
const matchesEmojiLiteral = parseUnicodeEmojiCode(emoji.emoji_code) === query;
184-
185-
if (matchesEmojiLiteral || matcher(emoji)) {
180+
if (matcher(emoji)) {
186181
allMatchingEmoji.set(emoji.emoji_name, emoji);
187182
}
188183
}

0 commit comments

Comments
 (0)