mirror of https://github.com/zulip/zulip.git
emoji_picker: Convert _.any used as loop to for…of.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
2f314a0854
commit
4fbee73d1a
|
@ -216,15 +216,15 @@ function filter_emojis() {
|
||||||
const emojis = category.emojis;
|
const emojis = category.emojis;
|
||||||
|
|
||||||
for (const emoji_dict of emojis) {
|
for (const emoji_dict of emojis) {
|
||||||
_.any(emoji_dict.aliases, function (alias) {
|
for (const alias of emoji_dict.aliases) {
|
||||||
const match = _.every(search_terms, function (search_term) {
|
const match = _.every(search_terms, function (search_term) {
|
||||||
return alias.indexOf(search_term) >= 0;
|
return alias.indexOf(search_term) >= 0;
|
||||||
});
|
});
|
||||||
if (match) {
|
if (match) {
|
||||||
search_results.push(_.extend({}, emoji_dict, {name: alias}));
|
search_results.push(_.extend({}, emoji_dict, {name: alias}));
|
||||||
return true;
|
break; // We only need the first matching alias per emoji.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue