diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-02-26 11:19:05 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-02-26 11:19:05 -0500 |
commit | 53d0bce1da190d45ffd8dbf4afcf7e8b2878bad5 (patch) | |
tree | 53043d11186353b54e107466e72c55178e874a22 /web/react/components/posts_view_container.jsx | |
parent | 3734145f9676946792a3efab842812e547cbdab1 (diff) | |
parent | d563bf11527698bef02fc4b17852e260ba43f4e8 (diff) | |
download | chat-53d0bce1da190d45ffd8dbf4afcf7e8b2878bad5.tar.gz chat-53d0bce1da190d45ffd8dbf4afcf7e8b2878bad5.tar.bz2 chat-53d0bce1da190d45ffd8dbf4afcf7e8b2878bad5.zip |
Merge pull request #2257 from mattermost/rhs-profile-fix
Final fixes for user store changes
Diffstat (limited to 'web/react/components/posts_view_container.jsx')
-rw-r--r-- | web/react/components/posts_view_container.jsx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/web/react/components/posts_view_container.jsx b/web/react/components/posts_view_container.jsx index 1b14e8681..92d658b55 100644 --- a/web/react/components/posts_view_container.jsx +++ b/web/react/components/posts_view_container.jsx @@ -6,7 +6,6 @@ import LoadingScreen from './loading_screen.jsx'; import ChannelStore from '../stores/channel_store.jsx'; import PostStore from '../stores/post_store.jsx'; -import UserStore from '../stores/user_store.jsx'; import * as Utils from '../utils/utils.jsx'; import * as EventHelpers from '../dispatcher/event_helpers.jsx'; @@ -25,13 +24,11 @@ export default class PostsViewContainer extends React.Component { this.handlePostsViewScroll = this.handlePostsViewScroll.bind(this); this.loadMorePostsTop = this.loadMorePostsTop.bind(this); this.handlePostsViewJumpRequest = this.handlePostsViewJumpRequest.bind(this); - this.onUserChange = this.onUserChange.bind(this); const currentChannelId = ChannelStore.getCurrentId(); const state = { scrollType: PostsView.SCROLL_TYPE_BOTTOM, - scrollPost: null, - profiles: JSON.parse(JSON.stringify(UserStore.getProfiles())) + scrollPost: null }; if (currentChannelId) { Object.assign(state, { @@ -57,14 +54,12 @@ export default class PostsViewContainer extends React.Component { ChannelStore.addLeaveListener(this.onChannelLeave); PostStore.addChangeListener(this.onPostsChange); PostStore.addPostsViewJumpListener(this.handlePostsViewJumpRequest); - UserStore.addChangeListener(this.onUserChange); } componentWillUnmount() { ChannelStore.removeChangeListener(this.onChannelChange); ChannelStore.removeLeaveListener(this.onChannelLeave); PostStore.removeChangeListener(this.onPostsChange); PostStore.removePostsViewJumpListener(this.handlePostsViewJumpRequest); - UserStore.removeChangeListener(this.onUserChange); } handlePostsViewJumpRequest(type, post) { switch (type) { @@ -140,9 +135,6 @@ export default class PostsViewContainer extends React.Component { atTop[this.state.currentChannelIndex] = PostStore.getVisibilityAtTop(currentChannelId); this.setState({postLists, atTop}); } - onUserChange() { - this.setState({profiles: JSON.parse(JSON.stringify(UserStore.getProfiles()))}); - } getChannelPosts(id) { return PostStore.getVisiblePosts(id); } @@ -188,7 +180,7 @@ export default class PostsViewContainer extends React.Component { showMoreMessagesBottom={false} introText={channel ? createChannelIntroMessage(channel) : null} messageSeparatorTime={this.state.currentLastViewed} - profiles={this.state.profiles} + profiles={this.props.profiles} /> ); if (!postLists[i] && isActive) { @@ -208,3 +200,7 @@ export default class PostsViewContainer extends React.Component { ); } } + +PostsViewContainer.propTypes = { + profiles: React.PropTypes.object +}; |