summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-03-09 09:00:36 -0500
committerJoramWilander <jwawilander@gmail.com>2016-03-09 09:00:36 -0500
commit1a38fbf681422a1b14fceeb3dc3f16e43e8e62a6 (patch)
treec890f452821206c668597864062f5083623b0dc3 /web
parentd9eb8c0c5840b169da6e424ffa894dde4c632dd4 (diff)
downloadchat-1a38fbf681422a1b14fceeb3dc3f16e43e8e62a6.tar.gz
chat-1a38fbf681422a1b14fceeb3dc3f16e43e8e62a6.tar.bz2
chat-1a38fbf681422a1b14fceeb3dc3f16e43e8e62a6.zip
Fix ... for usernames on first page load
Diffstat (limited to 'web')
-rw-r--r--web/react/components/post.jsx6
-rw-r--r--web/react/components/post_body.jsx3
-rw-r--r--web/react/components/posts_view.jsx1
-rw-r--r--web/react/components/posts_view_container.jsx10
4 files changed, 10 insertions, 10 deletions
diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx
index 889d4311e..57e919e45 100644
--- a/web/react/components/post.jsx
+++ b/web/react/components/post.jsx
@@ -98,7 +98,7 @@ export default class Post extends React.Component {
return true;
}
- if (nextProps.hasProfiles !== this.props.hasProfiles) {
+ if (!Utils.areObjectsEqual(nextProps.user, this.props.user)) {
return true;
}
@@ -226,7 +226,6 @@ export default class Post extends React.Component {
posts={posts}
handleCommentClick={this.handleCommentClick}
retryPost={this.retryPost}
- hasProfiles={this.props.hasProfiles}
/>
</div>
</div>
@@ -246,6 +245,5 @@ Post.propTypes = {
hideProfilePic: React.PropTypes.bool,
isLastComment: React.PropTypes.bool,
shouldHighlight: React.PropTypes.bool,
- displayNameType: React.PropTypes.string,
- hasProfiles: React.PropTypes.bool
+ displayNameType: React.PropTypes.string
};
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx
index 70cf86748..854cb095a 100644
--- a/web/react/components/post_body.jsx
+++ b/web/react/components/post_body.jsx
@@ -215,8 +215,7 @@ PostBody.propTypes = {
post: React.PropTypes.object.isRequired,
parentPost: React.PropTypes.object,
retryPost: React.PropTypes.func.isRequired,
- handleCommentClick: React.PropTypes.func.isRequired,
- hasProfiles: React.PropTypes.bool
+ handleCommentClick: React.PropTypes.func.isRequired
};
export default injectIntl(PostBody);
diff --git a/web/react/components/posts_view.jsx b/web/react/components/posts_view.jsx
index 9a1673483..c2c739e9a 100644
--- a/web/react/components/posts_view.jsx
+++ b/web/react/components/posts_view.jsx
@@ -250,7 +250,6 @@ export default class PostsView extends React.Component {
shouldHighlight={shouldHighlight}
onClick={() => EventHelpers.emitPostFocusEvent(post.id)} //eslint-disable-line no-loop-func
displayNameType={this.state.displayNameType}
- hasProfiles={profiles && Object.keys(profiles).length > 1}
user={profile}
/>
);
diff --git a/web/react/components/posts_view_container.jsx b/web/react/components/posts_view_container.jsx
index 92d658b55..976e03fab 100644
--- a/web/react/components/posts_view_container.jsx
+++ b/web/react/components/posts_view_container.jsx
@@ -149,11 +149,15 @@ export default class PostsViewContainer extends React.Component {
}
}
shouldComponentUpdate(nextProps, nextState) {
- if (Utils.areObjectsEqual(this.state, nextState)) {
- return false;
+ if (!Utils.areObjectsEqual(this.state, nextState)) {
+ return true;
}
- return true;
+ if (!Utils.areObjectsEqual(this.props, nextProps)) {
+ return true;
+ }
+
+ return false;
}
render() {
const postLists = this.state.postLists;