summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-05-30 11:12:08 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-05-30 11:12:08 -0400
commitabde1da60c2ca8e861e42af89b062d67c299ff9c (patch)
tree71605d81bcd67fe57cc4bee5defb23b81c754022
parent6c86ec3e4cc8137116d09e9db583b43fff659d30 (diff)
downloadchat-abde1da60c2ca8e861e42af89b062d67c299ff9c.tar.gz
chat-abde1da60c2ca8e861e42af89b062d67c299ff9c.tar.bz2
chat-abde1da60c2ca8e861e42af89b062d67c299ff9c.zip
User display names now update immediately after changing display setting (#3155)
-rw-r--r--webapp/components/post_view/components/post.jsx1
-rw-r--r--webapp/components/post_view/components/post_header.jsx10
-rw-r--r--webapp/components/user_profile.jsx7
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}
/>
<PostBody
post={post}
diff --git a/webapp/components/post_view/components/post_header.jsx b/webapp/components/post_view/components/post_header.jsx
index 3e7650d7f..b79b732bc 100644
--- a/webapp/components/post_view/components/post_header.jsx
+++ b/webapp/components/post_view/components/post_header.jsx
@@ -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
};
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
};