1
0
Fork 0
forked from gitea/nas

Fix reaction_deck api structure

This commit is contained in:
KMY 2023-05-26 17:26:50 +09:00
parent 3f9a75c72f
commit f382b16fde
3 changed files with 55 additions and 7 deletions

View file

@ -45,7 +45,7 @@ const getFrequentlyUsedEmojis = createSelector([
const { emojiCounters, reactionDeck } = data;
let deckEmojis = reactionDeck
.toArray()
.map((e) => e.get('emoji'))
.map((e) => e.getIn(['emoji', 'shortcode']))
.filter((e) => e)
.map((e) => shortCodes[e] || e);
deckEmojis = [...new Set(deckEmojis)];
@ -70,6 +70,8 @@ const getFrequentlyUsedEmojis = createSelector([
emojis = deckEmojis.slice(0, DECK_SIZE).concat(emojis);
if (emojis.length <= 0) emojis = ['+1'];
return emojis;
});