mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe.git
synced 2024-11-09 10:13:42 +00:00
Merge pull request 'Do not copy all emojis in recentEmoji getter' (#340) from sn0w/akkoma-fe:feature/optimize-recent-emojis into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma-fe/pulls/340
This commit is contained in:
commit
58be48d164
1 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
}, []),
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue