diff options
-rw-r--r-- | webapp/components/delete_post_modal.jsx | 1 | ||||
-rw-r--r-- | webapp/components/post_view/components/post_info.jsx | 5 | ||||
-rw-r--r-- | webapp/components/rhs_comment.jsx | 5 | ||||
-rw-r--r-- | webapp/stores/post_store.jsx | 5 |
4 files changed, 13 insertions, 3 deletions
diff --git a/webapp/components/delete_post_modal.jsx b/webapp/components/delete_post_modal.jsx index 6563e3ee8..5f21ea3bc 100644 --- a/webapp/components/delete_post_modal.jsx +++ b/webapp/components/delete_post_modal.jsx @@ -55,7 +55,6 @@ export default class DeletePostModal extends React.Component { this.state.post.id, () => { PostStore.deletePost(this.state.post); - AsyncClient.getPosts(this.state.post.channel_id); if (this.state.post.id === PostStore.getSelectedPostId()) { AppDispatcher.handleServerAction({ diff --git a/webapp/components/post_view/components/post_info.jsx b/webapp/components/post_view/components/post_info.jsx index e95afe3ed..81e6a1fc2 100644 --- a/webapp/components/post_view/components/post_info.jsx +++ b/webapp/components/post_view/components/post_info.jsx @@ -147,7 +147,10 @@ export default class PostInfo extends React.Component { <a href='#' role='menuitem' - onClick={() => GlobalActions.showDeletePostModal(post, dataComments)} + onClick={(e) => { + e.preventDefault(); + GlobalActions.showDeletePostModal(post, dataComments); + }} > <FormattedMessage id='post_info.del' diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx index 1114d6fa1..2419e8316 100644 --- a/webapp/components/rhs_comment.jsx +++ b/webapp/components/rhs_comment.jsx @@ -200,7 +200,10 @@ export default class RhsComment extends React.Component { <a href='#' role='menuitem' - onClick={() => GlobalActions.showDeletePostModal(post, 0)} + onClick={(e) => { + e.preventDefault(); + GlobalActions.showDeletePostModal(post, 0); + }} > <FormattedMessage id='rhs_comment.del' diff --git a/webapp/stores/post_store.jsx b/webapp/stores/post_store.jsx index 7b3d337f3..0d838a3df 100644 --- a/webapp/stores/post_store.jsx +++ b/webapp/stores/post_store.jsx @@ -216,6 +216,11 @@ class PostStoreClass extends EventEmitter { if (combinedPosts.order.indexOf(pid) === -1 && newPosts.order.indexOf(pid) !== -1) { combinedPosts.order.push(pid); } + } else if (combinedPosts.posts.hasOwnProperty(pid)) { + combinedPosts.posts[pid] = Object.assign({}, np, { + state: Constants.POST_DELETED, + filenames: [] + }); } } } |