2017-09-23 13:40:28 +10:00
|
|
|
import { List as ImmutableList } from 'immutable';
|
|
|
|
import { STORE_HYDRATE } from '../actions/store';
|
2017-10-06 12:42:34 +11:00
|
|
|
import { search as emojiSearch } from '../features/emoji/emoji_mart_search_light';
|
|
|
|
import { buildCustomEmojis } from '../features/emoji/emoji';
|
2017-09-23 13:40:28 +10:00
|
|
|
|
|
|
|
const initialState = ImmutableList();
|
|
|
|
|
2017-09-23 22:47:32 +10:00
|
|
|
export default function custom_emojis(state = initialState, action) {
|
2017-09-23 13:40:28 +10:00
|
|
|
switch(action.type) {
|
|
|
|
case STORE_HYDRATE:
|
2017-10-02 16:22:24 +11:00
|
|
|
emojiSearch('', { custom: buildCustomEmojis(action.state.get('custom_emojis', [])) });
|
2017-09-23 13:40:28 +10:00
|
|
|
return action.state.get('custom_emojis');
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|