diff --git a/webapp/components/post_view/reaction/reaction.jsx b/webapp/components/post_view/reaction/reaction.jsx index 5b65e604f6..7fad56d624 100644 --- a/webapp/components/post_view/reaction/reaction.jsx +++ b/webapp/components/post_view/reaction/reaction.jsx @@ -41,6 +41,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 */ @@ -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} } - onEnter={this.props.actions.getMissingProfilesByIds} + onEnter={this.loadMissingProfiles} >