You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
623 B

  1. import { List as ImmutableList, fromJS as ConvertToImmutable } from 'immutable';
  2. import { CUSTOM_EMOJIS_FETCH_SUCCESS } from 'flavours/glitch/actions/custom_emojis';
  3. import { search as emojiSearch } from 'flavours/glitch/util/emoji/emoji_mart_search_light';
  4. import { buildCustomEmojis } from 'flavours/glitch/util/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. };