From abde1da60c2ca8e861e42af89b062d67c299ff9c Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 30 May 2016 11:12:08 -0400 Subject: User display names now update immediately after changing display setting (#3155) --- webapp/components/post_view/components/post.jsx | 1 + webapp/components/post_view/components/post_header.jsx | 10 ++++++++-- webapp/components/user_profile.jsx | 7 ++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/webapp/components/post_view/components/post.jsx b/webapp/components/post_view/components/post.jsx index 0bf4680fe..2ed062c74 100644 --- a/webapp/components/post_view/components/post.jsx +++ b/webapp/components/post_view/components/post.jsx @@ -182,6 +182,7 @@ export default class Post extends React.Component { user={this.props.user} currentUser={this.props.currentUser} compactDisplay={this.props.compactDisplay} + displayNameType={this.props.displayNameType} /> ; + let userProfile = ( + + ); let botIndicator; if (post.props && post.props.from_webhook) { @@ -80,5 +85,6 @@ PostHeader.propTypes = { isLastComment: React.PropTypes.bool.isRequired, handleCommentClick: React.PropTypes.func.isRequired, sameUser: React.PropTypes.bool.isRequired, - compactDisplay: React.PropTypes.bool + compactDisplay: React.PropTypes.bool, + displayNameType: React.PropTypes.string }; diff --git a/webapp/components/user_profile.jsx b/webapp/components/user_profile.jsx index 673422d3f..e68ff7eab 100644 --- a/webapp/components/user_profile.jsx +++ b/webapp/components/user_profile.jsx @@ -39,6 +39,10 @@ export default class UserProfile extends React.Component { return true; } + if (nextProps.displayNameType !== this.props.displayNameType) { + return true; + } + return false; } render() { @@ -138,5 +142,6 @@ UserProfile.propTypes = { user: React.PropTypes.object, overwriteName: React.PropTypes.string, overwriteImage: React.PropTypes.string, - disablePopover: React.PropTypes.bool + disablePopover: React.PropTypes.bool, + displayNameType: React.PropTypes.string }; -- cgit v1.2.3-1-g7c22