diff options
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/post_view/reaction/reaction.jsx | 12 | ||||
-rw-r--r-- | webapp/components/suggestion/emoticon_provider.jsx | 9 |
2 files changed, 18 insertions, 3 deletions
diff --git a/webapp/components/post_view/reaction/reaction.jsx b/webapp/components/post_view/reaction/reaction.jsx index 5b65e604f..7fad56d62 100644 --- a/webapp/components/post_view/reaction/reaction.jsx +++ b/webapp/components/post_view/reaction/reaction.jsx @@ -42,6 +42,11 @@ export default class Reaction extends React.PureComponent { otherUsersCount: PropTypes.number.isRequired, /* + * Array of reactions by user + */ + reactions: PropTypes.arrayOf(PropTypes.object).isRequired, + + /* * The URL of the emoji image */ emojiImageUrl: PropTypes.string.isRequired, @@ -82,6 +87,11 @@ export default class Reaction extends React.PureComponent { this.props.actions.removeReaction(this.props.post.id, this.props.emojiName); } + loadMissingProfiles = () => { + const ids = this.props.reactions.map((reaction) => reaction.user_id); + this.props.actions.getMissingProfilesByIds(ids); + } + render() { let currentUserReacted = false; const users = []; @@ -219,7 +229,7 @@ export default class Reaction extends React.PureComponent { {clickTooltip} </Tooltip> } - onEnter={this.props.actions.getMissingProfilesByIds} + onEnter={this.loadMissingProfiles} > <div className={className} diff --git a/webapp/components/suggestion/emoticon_provider.jsx b/webapp/components/suggestion/emoticon_provider.jsx index 0a7f1ff8a..1de35dc20 100644 --- a/webapp/components/suggestion/emoticon_provider.jsx +++ b/webapp/components/suggestion/emoticon_provider.jsx @@ -3,12 +3,15 @@ import React from 'react'; -import EmojiStore from 'stores/emoji_store.jsx'; +import {default as EmojiStore, EmojiMap} from 'stores/emoji_store.jsx'; import * as Emoticons from 'utils/emoticons.jsx'; import SuggestionStore from 'stores/suggestion_store.jsx'; import Suggestion from './suggestion.jsx'; +import store from 'stores/redux_store.jsx'; +import {getCustomEmojisByName} from 'mattermost-redux/selectors/entities/emojis'; + const MIN_EMOTICON_LENGTH = 2; class EmoticonSuggestion extends Suggestion { @@ -71,8 +74,10 @@ export default class EmoticonProvider { } } + const emojis = new EmojiMap(getCustomEmojisByName(store.getState())); + // check for named emoji - for (const [name, emoji] of EmojiStore.getEmojis()) { + for (const [name, emoji] of emojis) { if (emoji.aliases) { // This is a system emoji so it may have multiple names for (const alias of emoji.aliases) { |