From 414b208100a36975d2fa238f4adfb33b20212122 Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Tue, 20 Jun 2017 11:47:53 -0400
Subject: PLT-6885/PLT-6888 Fix custom emojis (#6694)

* Fix custom emojis

* Fix custom emoji reactions
---
 webapp/actions/emoji_actions.jsx | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

(limited to 'webapp/actions/emoji_actions.jsx')

diff --git a/webapp/actions/emoji_actions.jsx b/webapp/actions/emoji_actions.jsx
index ed8bc84f7..e5c9751c0 100644
--- a/webapp/actions/emoji_actions.jsx
+++ b/webapp/actions/emoji_actions.jsx
@@ -1,35 +1,20 @@
 // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
 // See License.txt for license information.
 
-import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
-
 import UserStore from 'stores/user_store.jsx';
 
-import * as AsyncClient from 'utils/async_client.jsx';
-import Client from 'client/web_client.jsx';
-
-import {ActionTypes} from 'utils/constants.jsx';
-
-// Redux actions
 import store from 'stores/redux_store.jsx';
 const dispatch = store.dispatch;
 const getState = store.getState;
 import {getProfilesByIds} from 'mattermost-redux/actions/users';
+import {getAllCustomEmojis} from 'mattermost-redux/actions/emojis';
 
 export function loadEmoji(getProfiles = true) {
-    Client.listEmoji(
+    getAllCustomEmojis(10000)(dispatch, getState).then(
         (data) => {
-            AppDispatcher.handleServerAction({
-                type: ActionTypes.RECEIVED_CUSTOM_EMOJIS,
-                emojis: data
-            });
-
             if (getProfiles) {
                 loadProfilesForEmoji(data);
             }
-        },
-        (err) => {
-            AsyncClient.dispatchError(err, 'listEmoji');
         }
     );
 }
-- 
cgit v1.2.3-1-g7c22

