From 66604e987cfd8fac71e7b9b344b7449b3c70c80d Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Wed, 8 Jun 2022 12:37:22 +0100 Subject: [PATCH] allow custom reactions --- src/components/react_button/react_button.js | 10 ++++++++-- src/components/react_button/react_button.vue | 9 ++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/react_button/react_button.js b/src/components/react_button/react_button.js index ce82c90d..7531fbc8 100644 --- a/src/components/react_button/react_button.js +++ b/src/components/react_button/react_button.js @@ -45,7 +45,10 @@ const ReactButton = { if (this.filterWord !== '') { const filterWordLowercase = this.filterWord.toLowerCase() let orderedEmojiList = [] - for (const emoji of this.$store.state.instance.emoji) { + for (const emoji of [ + ...this.$store.state.instance.emoji, + ...this.$store.state.instance.customEmoji + ]) { if (emoji.replacement === this.filterWord) return [emoji] const indexOfFilterWord = emoji.displayText.toLowerCase().indexOf(filterWordLowercase) @@ -58,7 +61,10 @@ const ReactButton = { } return orderedEmojiList.flat() } - return this.$store.state.instance.emoji || [] + return [ + ...this.$store.state.instance.emoji, + ...this.$store.state.instance.customEmoji + ] || [] }, mergedConfig () { return this.$store.getters.mergedConfig diff --git a/src/components/react_button/react_button.vue b/src/components/react_button/react_button.vue index 7f35b7b5..51f68513 100644 --- a/src/components/react_button/react_button.vue +++ b/src/components/react_button/react_button.vue @@ -34,7 +34,14 @@ :title="emoji.displayText" @click="addReaction($event, emoji.replacement, close)" > - {{ emoji.replacement }} + + + {{ emoji.replacement }} +