Commit abde1da6 authored by Joram Wilander's avatar Joram Wilander
Browse files

User display names now update immediately after changing display setting (#3155)

parent 6c86ec3e
......@@ -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}
/>
<PostBody
post={post}
......
......@@ -19,7 +19,12 @@ export default class PostHeader extends React.Component {
render() {
const post = this.props.post;
let userProfile = <UserProfile user={this.props.user}/>;
let userProfile = (
<UserProfile
user={this.props.user}
displayNameType={this.props.displayNameType}
/>
);
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
};
......@@ -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
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment