]> cat aescling's git repositories - mastodon.git/blobdiff - app/javascript/mastodon/reducers/custom_emojis.js
Add emoji autosuggest (#5053)
[mastodon.git] / app / javascript / mastodon / reducers / custom_emojis.js
index 15bba7bccd3d3811a56d77f5e172c565fa028615..d80c0d156a974dc25ea7ad21680f40029bf07dd8 100644 (file)
@@ -1,11 +1,14 @@
 import { List as ImmutableList } from 'immutable';
 import { STORE_HYDRATE } from '../actions/store';
+import { emojiIndex } from 'emoji-mart';
+import { buildCustomEmojis } from '../emoji';
 
 const initialState = ImmutableList();
 
-export default function statuses(state = initialState, action) {
+export default function custom_emojis(state = initialState, action) {
   switch(action.type) {
   case STORE_HYDRATE:
+    emojiIndex.search('', { custom: buildCustomEmojis(action.state.get('custom_emojis', [])) });
     return action.state.get('custom_emojis');
   default:
     return state;
This page took 0.026065 seconds and 3 git commands to generate.