From a419bce7097b0ff438ff5b3a5a8bdbd35e69090d Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Mon, 29 Oct 2018 23:35:34 +0900 Subject: [PATCH] fix: Remove duplicated emojis when suggest --- .../components/TimelineSpace/Modals/NewToot/Status.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue b/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue index 89c86aec..ff7945ed 100644 --- a/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue +++ b/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue @@ -184,12 +184,13 @@ export default { // Find custom emojis const filteredCustomEmoji = this.customEmojis.filter(emoji => emoji.name.includes(word)) const filtered = filteredNativeEmoji.concat(filteredCustomEmoji) - console.log(filtered) if (filtered.length > 0) { this.openSuggest = true this.startIndex = start this.matchWord = word - this.filteredSuggestion = filtered + this.filteredSuggestion = filtered.filter((e, i, array) => { + return (array.findIndex(ar => e.code === ar.code) === i) + }) } else { this.openSuggest = false }