Echo 4b67d8e34f [Glitch] Emoji: Add back to state
Port 963a54664804e60ea8e30795090a0f20de7a48dc to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2026-06-16 21:52:32 +02:00

26 lines
603 B
TypeScript

import { createAppSelector, useAppSelector } from '@/flavours/glitch/store';
import type { ExtraCustomEmojiMap } from '../features/emoji/types';
const selectCustomEmojis = createAppSelector(
[(state) => state.emojis.custom],
(custom) => {
const emojis: ExtraCustomEmojiMap = {};
for (const shortcode in custom) {
const emoji = custom[shortcode];
if (!emoji) {
continue;
}
emojis[shortcode] = {
shortcode,
...emoji,
};
}
return emojis;
},
);
export function useCustomEmojis() {
return useAppSelector(selectCustomEmojis);
}