aboutsummaryrefslogtreecommitdiff
path: root/src/modules/instance.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/instance.js')
-rw-r--r--src/modules/instance.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/modules/instance.js b/src/modules/instance.js
index 23f534c3..8aadce77 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -115,6 +115,24 @@ const instance = {
.map(key => [key, state[key]])
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})
},
+ groupedCustomEmojis (state) {
+ return state.customEmoji
+ .reduce((res, emoji) => {
+ emoji.tags.forEach(packName => {
+ const packId = `custom-${packName}`
+ if (!res[packId]) {
+ res[packId] = ({
+ id: packId,
+ text: packName,
+ image: emoji.imageUrl,
+ emojis: []
+ })
+ }
+ res[packId].emojis.push(emoji)
+ })
+ return res
+ }, {})
+ },
instanceDomain (state) {
return new URL(state.server).hostname
}