diff options
author | enahum <nahumhbl@gmail.com> | 2016-06-09 15:28:57 -0300 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-06-09 11:28:57 -0700 |
commit | 18c53e03ebaf1021c5b8429ef7bce09e5de0c4a6 (patch) | |
tree | ccaa7bd967f50d005e517401abcfc59536fa18c9 /webapp/components | |
parent | f1eefd99e6e40621ace005afcb1c08c6a69a744e (diff) | |
download | chat-18c53e03ebaf1021c5b8429ef7bce09e5de0c4a6.tar.gz chat-18c53e03ebaf1021c5b8429ef7bce09e5de0c4a6.tar.bz2 chat-18c53e03ebaf1021c5b8429ef7bce09e5de0c4a6.zip |
PLT-3221 Remove async call to get posts when creating a comment and editing a post (#3300)
PLT-3203 Commenting on the RHS while in permalink view makes the message not show up in the RHS
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/create_comment.jsx | 18 | ||||
-rw-r--r-- | webapp/components/post_view/components/post_list.jsx | 8 | ||||
-rw-r--r-- | webapp/components/post_view/post_focus_view_controller.jsx | 1 |
3 files changed, 10 insertions, 17 deletions
diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx index 73758e73c..454d8bf43 100644 --- a/webapp/components/create_comment.jsx +++ b/webapp/components/create_comment.jsx @@ -5,7 +5,6 @@ import $ from 'jquery'; import ReactDOM from 'react-dom'; import AppDispatcher from '../dispatcher/app_dispatcher.jsx'; import Client from 'utils/web_client.jsx'; -import ChannelStore from 'stores/channel_store.jsx'; import UserStore from 'stores/user_store.jsx'; import PostDeletedModal from './post_deleted_modal.jsx'; import PostStore from 'stores/post_store.jsx'; @@ -144,22 +143,11 @@ class CreateComment extends React.Component { post.user_id = userId; post.create_at = time; - PostStore.storePendingPost(post); - PostStore.storeCommentDraft(this.props.rootId, null); - + GlobalActions.emitUserCommentedEvent(post); Client.createPost( post, - (data) => { - const channel = ChannelStore.get(this.props.channelId); - const member = ChannelStore.getMember(this.props.channelId); - member.msg_count = channel.total_msg_count; - member.last_viewed_at = Date.now(); - ChannelStore.setChannelMember(member); - - AppDispatcher.handleServerAction({ - type: ActionTypes.RECEIVED_POST, - post: data - }); + () => { + // DO nothing. Websockets will handle this. }, (err) => { if (err.id === 'api.post.create_post.root_id.app_error') { diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx index 28be93544..902ad25bf 100644 --- a/webapp/components/post_view/components/post_list.jsx +++ b/webapp/components/post_view/components/post_list.jsx @@ -137,7 +137,10 @@ export default class PostList extends React.Component { } loadMorePostsTop() { - GlobalActions.emitLoadMorePostsEvent(); + if (this.props.isFocusPost) { + return GlobalActions.emitLoadMorePostsFocusedTopEvent(); + } + return GlobalActions.emitLoadMorePostsEvent(); } loadMorePostsBottom() { @@ -522,5 +525,6 @@ PostList.propTypes = { displayNameType: React.PropTypes.string, displayPostsInCenter: React.PropTypes.bool, compactDisplay: React.PropTypes.bool, - previewsCollapsed: React.PropTypes.string + previewsCollapsed: React.PropTypes.string, + isFocusPost: React.PropTypes.bool }; diff --git a/webapp/components/post_view/post_focus_view_controller.jsx b/webapp/components/post_view/post_focus_view_controller.jsx index 7c1da6566..c70ebb0f5 100644 --- a/webapp/components/post_view/post_focus_view_controller.jsx +++ b/webapp/components/post_view/post_focus_view_controller.jsx @@ -115,6 +115,7 @@ export default class PostFocusView extends React.Component { showMoreMessagesTop={!this.state.atTop} showMoreMessagesBottom={!this.state.atBottom} postsToHighlight={postsToHighlight} + isFocusPost={true} /> ); } |