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
523 B

  1. import { List as ImmutableList } from 'immutable';
  2. import { STORE_HYDRATE } from '../actions/store';
  3. import { emojiIndex } from 'emoji-mart';
  4. import { buildCustomEmojis } from '../emoji';
  5. const initialState = ImmutableList();
  6. export default function custom_emojis(state = initialState, action) {
  7. switch(action.type) {
  8. case STORE_HYDRATE:
  9. emojiIndex.search('', { custom: buildCustomEmojis(action.state.get('custom_emojis', [])) });
  10. return action.state.get('custom_emojis');
  11. default:
  12. return state;
  13. }
  14. };