logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

custom_emojis.js (598B)


  1. import { List as ImmutableList, fromJS as ConvertToImmutable } from 'immutable';
  2. import { CUSTOM_EMOJIS_FETCH_SUCCESS } from '../actions/custom_emojis';
  3. import { search as emojiSearch } from '../features/emoji/emoji_mart_search_light';
  4. import { buildCustomEmojis } from '../features/emoji/emoji';
  5. const initialState = ImmutableList([]);
  6. export default function custom_emojis(state = initialState, action) {
  7. if(action.type === CUSTOM_EMOJIS_FETCH_SUCCESS) {
  8. state = ConvertToImmutable(action.custom_emojis);
  9. emojiSearch('', { custom: buildCustomEmojis(state) });
  10. }
  11. return state;
  12. };