This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2017-09-22 20:40:28 -07:00
|
|
|
import { List as ImmutableList } from 'immutable';
|
2017-11-17 19:11:18 -08:00
|
|
|
import { STORE_HYDRATE } from 'themes/glitch/actions/store';
|
|
|
|
import { search as emojiSearch } from 'themes/glitch/util/emoji/emoji_mart_search_light';
|
|
|
|
import { buildCustomEmojis } from 'themes/glitch/util/emoji';
|
2017-09-22 20:40:28 -07:00
|
|
|
|
|
|
|
const initialState = ImmutableList();
|
|
|
|
|
2017-09-23 05:47:32 -07:00
|
|
|
export default function custom_emojis(state = initialState, action) {
|
2017-09-22 20:40:28 -07:00
|
|
|
switch(action.type) {
|
|
|
|
case STORE_HYDRATE:
|
2017-10-31 14:58:07 -07:00
|
|
|
emojiSearch('', { custom: buildCustomEmojis(action.state.get('custom_emojis', [])) });
|
2017-09-22 20:40:28 -07:00
|
|
|
return action.state.get('custom_emojis');
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|