summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_body.jsx
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-02-22 11:09:35 -0500
committerJoramWilander <jwawilander@gmail.com>2016-02-22 11:10:31 -0500
commitc16071afc5320677bc2c13fa4dff941152e18970 (patch)
tree4eb5cd6efa2ad7ea60a2070bb6a10066f32fa3cf /web/react/components/post_body.jsx
parent9b30fad8ad4d9d83fd119ed9e4bfb591ebca46e2 (diff)
downloadchat-c16071afc5320677bc2c13fa4dff941152e18970.tar.gz
chat-c16071afc5320677bc2c13fa4dff941152e18970.tar.bz2
chat-c16071afc5320677bc2c13fa4dff941152e18970.zip
Move post_body profile change listener into posts view
Diffstat (limited to 'web/react/components/post_body.jsx')
-rw-r--r--web/react/components/post_body.jsx18
1 files changed, 2 insertions, 16 deletions
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx
index d71ac6ec7..efeabdfff 100644
--- a/web/react/components/post_body.jsx
+++ b/web/react/components/post_body.jsx
@@ -33,7 +33,6 @@ class PostBody extends React.Component {
this.isImgLoading = false;
- this.handleUserChange = this.handleUserChange.bind(this);
this.parseEmojis = this.parseEmojis.bind(this);
this.createEmbed = this.createEmbed.bind(this);
this.createImageEmbed = this.createImageEmbed.bind(this);
@@ -80,26 +79,12 @@ class PostBody extends React.Component {
componentDidMount() {
this.parseEmojis();
-
- UserStore.addChangeListener(this.handleUserChange);
}
componentDidUpdate() {
this.parseEmojis();
}
- componentWillUnmount() {
- UserStore.removeChangeListener(this.handleUserChange);
- }
-
- handleUserChange() {
- if (!this.state.hasProfiles) {
- const profiles = UserStore.getProfiles();
-
- this.setState({hasProfiles: profiles && Object.keys(profiles).length > 1});
- }
- }
-
componentWillReceiveProps(nextProps) {
const linkData = Utils.extractLinks(nextProps.post.message);
if (this.props.post.filenames.length === 0 && this.state.links && this.state.links.length > 0) {
@@ -357,7 +342,8 @@ PostBody.propTypes = {
post: React.PropTypes.object.isRequired,
parentPost: React.PropTypes.object,
retryPost: React.PropTypes.func.isRequired,
- handleCommentClick: React.PropTypes.func.isRequired
+ handleCommentClick: React.PropTypes.func.isRequired,
+ hasProfiles: React.PropTypes.bool
};
export default injectIntl(PostBody);