summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_focus_view.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-04-29 08:40:06 -0400
committerChristopher Speller <crspeller@gmail.com>2016-04-29 08:40:06 -0400
commit1f4974dc02c786b65c802d4497fd736cca79d01c (patch)
tree1007e452c4a9345dee8aff113f28f235432bf323 /webapp/components/post_focus_view.jsx
parent9961ccca7d39bdfabbafce423d3f7fe4b6ed2f29 (diff)
downloadchat-1f4974dc02c786b65c802d4497fd736cca79d01c.tar.gz
chat-1f4974dc02c786b65c802d4497fd736cca79d01c.tar.bz2
chat-1f4974dc02c786b65c802d4497fd736cca79d01c.zip
General react performance improvements (#2796)
* General React performance improvements * Cleaned up unused props/state in PermaLinkView and PostFocusView
Diffstat (limited to 'webapp/components/post_focus_view.jsx')
-rw-r--r--webapp/components/post_focus_view.jsx21
1 files changed, 2 insertions, 19 deletions
diff --git a/webapp/components/post_focus_view.jsx b/webapp/components/post_focus_view.jsx
index f3dfb46c6..d2fbb4532 100644
--- a/webapp/components/post_focus_view.jsx
+++ b/webapp/components/post_focus_view.jsx
@@ -5,7 +5,6 @@ import PostsView from './posts_view.jsx';
import PostStore from 'stores/post_store.jsx';
import ChannelStore from 'stores/channel_store.jsx';
-import UserStore from 'stores/user_store.jsx';
import * as GlobalActions from 'action_creators/global_actions.jsx';
import {FormattedMessage} from 'react-intl';
@@ -18,7 +17,6 @@ export default class PostFocusView extends React.Component {
this.onChannelChange = this.onChannelChange.bind(this);
this.onPostsChange = this.onPostsChange.bind(this);
- this.onUserChange = this.onUserChange.bind(this);
this.handlePostsViewScroll = this.handlePostsViewScroll.bind(this);
this.loadMorePostsTop = this.loadMorePostsTop.bind(this);
this.loadMorePostsBottom = this.loadMorePostsBottom.bind(this);
@@ -31,21 +29,18 @@ export default class PostFocusView extends React.Component {
scrollPostId: focusedPostId,
postList: PostStore.getVisiblePosts(focusedPostId),
atTop: PostStore.getVisibilityAtTop(focusedPostId),
- atBottom: PostStore.getVisibilityAtBottom(focusedPostId),
- currentUser: UserStore.getCurrentUser()
+ atBottom: PostStore.getVisibilityAtBottom(focusedPostId)
};
}
componentDidMount() {
ChannelStore.addChangeListener(this.onChannelChange);
PostStore.addChangeListener(this.onPostsChange);
- UserStore.addChangeListener(this.onUserChange);
}
componentWillUnmount() {
ChannelStore.removeChangeListener(this.onChannelChange);
PostStore.removeChangeListener(this.onPostsChange);
- UserStore.removeChangeListener(this.onUserChange);
}
onChannelChange() {
@@ -58,10 +53,6 @@ export default class PostFocusView extends React.Component {
}
}
- onUserChange() {
- this.setState({currentUser: UserStore.getCurrentUser()});
- }
-
onPostsChange() {
const focusedPostId = PostStore.getFocusedPostId();
if (focusedPostId == null) {
@@ -105,7 +96,7 @@ export default class PostFocusView extends React.Component {
const postsToHighlight = {};
postsToHighlight[this.state.scrollPostId] = true;
- if (!this.state.currentUser || !this.state.postList) {
+ if (!this.state.postList) {
return null;
}
@@ -125,16 +116,8 @@ export default class PostFocusView extends React.Component {
introText={this.getIntroMessage()}
messageSeparatorTime={0}
postsToHighlight={postsToHighlight}
- profiles={this.props.profiles}
- currentUser={this.state.currentUser}
/>
</div>
);
}
}
-PostFocusView.defaultProps = {
-};
-
-PostFocusView.propTypes = {
- profiles: React.PropTypes.object
-};