Do not copy all emojis in recentEmoji getter
ci/woodpecker/pr/woodpecker Pipeline was successful Details

This commit is contained in:
sn0w 2023-09-03 16:05:56 +02:00
parent 174f98b1cb
commit 6a1409e09b
Signed by untrusted user: sn0w
GPG Key ID: 52A4BAE175049057
1 changed files with 9 additions and 2 deletions

View File

@ -37,11 +37,18 @@ const recentEmojis = {
getters: {
recentEmojis: (state, getters, rootState) => state.emojis.reduce((objects, displayText) => {
const allEmojis = rootState.instance.emoji.concat(rootState.instance.customEmoji)
let emojiObject = allEmojis.find(emoji => emoji.displayText === displayText)
let comparator = emoji => emoji.displayText === displayText
let emojiObject = rootState.instance.emoji.find(comparator)
if (emojiObject !== undefined) {
objects.push(emojiObject)
} else {
emojiObject = rootState.instance.customEmoji.find(comparator)
if (emojiObject !== undefined) {
objects.push(emojiObject)
}
}
return objects
}, []),
},