From bc4fa6b198557a7f3989eb0865e2c77ac7451d29 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Sun, 3 Dec 2017 23:26:40 -0800 Subject: Rename themes -> flavours ? ? --- app/javascript/flavours/glitch/reducers/custom_emojis.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/javascript/flavours/glitch/reducers/custom_emojis.js (limited to 'app/javascript/flavours/glitch/reducers/custom_emojis.js') diff --git a/app/javascript/flavours/glitch/reducers/custom_emojis.js b/app/javascript/flavours/glitch/reducers/custom_emojis.js new file mode 100644 index 000000000..592cea8dc --- /dev/null +++ b/app/javascript/flavours/glitch/reducers/custom_emojis.js @@ -0,0 +1,16 @@ +import { List as ImmutableList } from 'immutable'; +import { STORE_HYDRATE } from 'flavours/glitch/actions/store'; +import { search as emojiSearch } from 'flavours/glitch/util/emoji/emoji_mart_search_light'; +import { buildCustomEmojis } from 'flavours/glitch/util/emoji'; + +const initialState = ImmutableList(); + +export default function custom_emojis(state = initialState, action) { + switch(action.type) { + case STORE_HYDRATE: + emojiSearch('', { custom: buildCustomEmojis(action.state.get('custom_emojis', [])) }); + return action.state.get('custom_emojis'); + default: + return state; + } +}; -- cgit