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.

16 lines
599 B

  1. import { List as ImmutableList } from 'immutable';
  2. import { STORE_HYDRATE } from 'flavours/glitch/actions/store';
  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. switch(action.type) {
  8. case STORE_HYDRATE:
  9. emojiSearch('', { custom: buildCustomEmojis(action.state.get('custom_emojis', [])) });
  10. return action.state.get('custom_emojis');
  11. default:
  12. return state;
  13. }
  14. };