mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
Deduplicate emojis even after using multiple matchers
Fixes flarum/core#968.
This commit is contained in:
parent
dbf82e4641
commit
16f3a09856
3
extensions/emoji/js/forum/dist/extension.js
vendored
3
extensions/emoji/js/forum/dist/extension.js
vendored
|
@ -235,7 +235,8 @@ System.register('flarum/emoji/addComposerAutocomplete', ['flarum/extend', 'flaru
|
|||
|
||||
var findMatchingEmojis = function findMatchingEmojis(matcher) {
|
||||
for (var _i = 0; _i < emojiKeys.length && maxSuggestions > 0; _i++) {
|
||||
if (matcher(emojiKeys[_i])) {
|
||||
var curEmoji = emojiKeys[_i];
|
||||
if (matcher(curEmoji) && similarEmoji.indexOf(curEmoji) === -1) {
|
||||
--maxSuggestions;
|
||||
similarEmoji.push(emojiKeys[_i]);
|
||||
}
|
||||
|
|
|
@ -106,7 +106,8 @@ export default function addComposerAutocomplete() {
|
|||
|
||||
const findMatchingEmojis = matcher => {
|
||||
for (let i = 0; i < emojiKeys.length && maxSuggestions > 0; i++) {
|
||||
if (matcher(emojiKeys[i])) {
|
||||
const curEmoji = emojiKeys[i];
|
||||
if (matcher(curEmoji) && similarEmoji.indexOf(curEmoji) === -1) {
|
||||
--maxSuggestions;
|
||||
similarEmoji.push(emojiKeys[i]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user