diff options
Diffstat (limited to 'webapp/components/post_view/reaction/reaction.jsx')
-rw-r--r-- | webapp/components/post_view/reaction/reaction.jsx | 12 |
1 files changed, 11 insertions, 1 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} |