fix: Remove duplicated emojis when suggest
This commit is contained in:
parent
07234367ce
commit
a419bce709
|
@ -184,12 +184,13 @@ export default {
|
||||||
// Find custom emojis
|
// Find custom emojis
|
||||||
const filteredCustomEmoji = this.customEmojis.filter(emoji => emoji.name.includes(word))
|
const filteredCustomEmoji = this.customEmojis.filter(emoji => emoji.name.includes(word))
|
||||||
const filtered = filteredNativeEmoji.concat(filteredCustomEmoji)
|
const filtered = filteredNativeEmoji.concat(filteredCustomEmoji)
|
||||||
console.log(filtered)
|
|
||||||
if (filtered.length > 0) {
|
if (filtered.length > 0) {
|
||||||
this.openSuggest = true
|
this.openSuggest = true
|
||||||
this.startIndex = start
|
this.startIndex = start
|
||||||
this.matchWord = word
|
this.matchWord = word
|
||||||
this.filteredSuggestion = filtered
|
this.filteredSuggestion = filtered.filter((e, i, array) => {
|
||||||
|
return (array.findIndex(ar => e.code === ar.code) === i)
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.openSuggest = false
|
this.openSuggest = false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue