From 3b4208ea41cad47287719412a44246129892762c Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Fri, 4 Aug 2023 16:48:13 +0100 Subject: [PATCH] debounce emoji searching --- src/components/emoji_picker/emoji_picker.js | 16 ++++------------ src/components/emoji_picker/emoji_picker.vue | 3 +-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index c0391f6c..9a2307cb 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -7,7 +7,7 @@ import { faStickyNote, faSmileBeam } from '@fortawesome/free-solid-svg-icons' -import { trim, escapeRegExp, startCase } from 'lodash' +import { trim, escapeRegExp, startCase, debounce } from 'lodash' library.add( faBoxOpen, @@ -42,6 +42,9 @@ const EmojiPicker = { EmojiGrid }, methods: { + debouncedSearch: debounce(function (e) { + this.keyword = e.target.value + }, 500), onStickerUploaded (e) { this.$emit('sticker-uploaded', e) }, @@ -85,17 +88,6 @@ const EmojiPicker = { activeGroupView () { return this.showingStickers ? '' : this.activeGroup }, - stickersAvailable () { - if (this.$store.state.instance.stickers) { - return this.$store.state.instance.stickers.length > 0 - } - return 0 - }, - filteredEmoji () { - return this.filterByKeyword( - this.$store.state.instance.customEmoji || [] - ) - }, emojis () { const recentEmojis = this.$store.getters.recentEmojis const standardEmojis = this.$store.state.instance.emoji || [] diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue index fe2e39b2..5a1088c0 100644 --- a/src/components/emoji_picker/emoji_picker.vue +++ b/src/components/emoji_picker/emoji_picker.vue @@ -44,11 +44,10 @@ >