summaryrefslogtreecommitdiffstats
path: root/webapp/components/emoji
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-06-26 08:16:57 -0400
committerGitHub <noreply@github.com>2017-06-26 08:16:57 -0400
commit23ccfc845ca2350075f6027e16c6206fc7b71716 (patch)
tree3fd1f896a5a24b43913be03b21c85638dd7c356e /webapp/components/emoji
parentfe7e9d95b30ae2195fcba68db960866db91ce045 (diff)
downloadchat-23ccfc845ca2350075f6027e16c6206fc7b71716.tar.gz
chat-23ccfc845ca2350075f6027e16c6206fc7b71716.tar.bz2
chat-23ccfc845ca2350075f6027e16c6206fc7b71716.zip
Move remaining actions over to use redux and v4 endpoints (#6720)
Diffstat (limited to 'webapp/components/emoji')
-rw-r--r--webapp/components/emoji/components/add_emoji.jsx7
-rw-r--r--webapp/components/emoji/components/emoji_list.jsx15
2 files changed, 9 insertions, 13 deletions
diff --git a/webapp/components/emoji/components/add_emoji.jsx b/webapp/components/emoji/components/add_emoji.jsx
index 2387ecfff..936e15d6b 100644
--- a/webapp/components/emoji/components/add_emoji.jsx
+++ b/webapp/components/emoji/components/add_emoji.jsx
@@ -1,11 +1,10 @@
-import PropTypes from 'prop-types';
-
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React from 'react';
+import PropTypes from 'prop-types';
-import * as AsyncClient from 'utils/async_client.jsx';
+import * as EmojiActions from 'actions/emoji_actions.jsx';
import EmojiStore from 'stores/emoji_store.jsx';
import BackstageHeader from 'components/backstage/components/backstage_header.jsx';
@@ -115,7 +114,7 @@ export default class AddEmoji extends React.Component {
return;
}
- AsyncClient.addEmoji(
+ EmojiActions.addEmoji(
emoji,
this.state.image,
() => {
diff --git a/webapp/components/emoji/components/emoji_list.jsx b/webapp/components/emoji/components/emoji_list.jsx
index f03638601..94d82caaa 100644
--- a/webapp/components/emoji/components/emoji_list.jsx
+++ b/webapp/components/emoji/components/emoji_list.jsx
@@ -7,14 +7,12 @@ import LoadingScreen from 'components/loading_screen.jsx';
import EmojiStore from 'stores/emoji_store.jsx';
import UserStore from 'stores/user_store.jsx';
-import {loadEmoji} from 'actions/emoji_actions.jsx';
+import * as EmojiActions from 'actions/emoji_actions.jsx';
-import * as AsyncClient from 'utils/async_client.jsx';
import * as Utils from 'utils/utils.jsx';
-import PropTypes from 'prop-types';
-
import React from 'react';
+import PropTypes from 'prop-types';
import {Link} from 'react-router';
import {FormattedMessage} from 'react-intl';
@@ -38,7 +36,7 @@ export default class EmojiList extends React.Component {
this.state = {
emojis: EmojiStore.getCustomEmojiMap(),
- loading: !EmojiStore.hasReceivedCustomEmojis(),
+ loading: true,
filter: '',
users: UserStore.getProfiles()
};
@@ -49,7 +47,7 @@ export default class EmojiList extends React.Component {
UserStore.addChangeListener(this.handleUserChange);
if (window.mm_config.EnableCustomEmoji === 'true') {
- loadEmoji();
+ EmojiActions.loadEmoji().then(() => this.setState({loading: false}));
}
this.updateTitle();
@@ -71,8 +69,7 @@ export default class EmojiList extends React.Component {
handleEmojiChange() {
this.setState({
- emojis: EmojiStore.getCustomEmojiMap(),
- loading: !EmojiStore.hasReceivedCustomEmojis()
+ emojis: EmojiStore.getCustomEmojiMap()
});
}
@@ -87,7 +84,7 @@ export default class EmojiList extends React.Component {
}
deleteEmoji(emoji) {
- AsyncClient.deleteEmoji(emoji.id);
+ EmojiActions.deleteEmoji(emoji.id);
}
render() {