logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: d648a6f8dc37a2ceb851f1cecde34fd6c54d7d1f
parent 3156f046b4215cab5edf272ae92538c5f1e2e1f1
Author: Tusooa Zhu <tusooa@kazv.moe>
Date:   Fri,  8 Oct 2021 15:30:55 -0400

Group emojis only by pack and remove pack: prefix

Ref: grouped-emoji-picker

Diffstat:

Msrc/modules/instance.js8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/modules/instance.js b/src/modules/instance.js @@ -116,9 +116,15 @@ const instance = { .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}) }, groupedCustomEmojis (state) { + const packsOf = emoji => { + return emoji.tags + .filter(k => k.startsWith('pack:')) + .map(k => k.slice(5)) // remove 'pack:' prefix + } + return state.customEmoji .reduce((res, emoji) => { - emoji.tags.forEach(packName => { + packsOf(emoji).forEach(packName => { const packId = `custom-${packName}` if (!res[packId]) { res[packId] = ({