Remove getPosts request after deleting a post (#3905)
Этот коммит содержится в:
коммит произвёл
enahum
родитель
391926e9a7
Коммит
3e14e8b5ab
@@ -55,7 +55,6 @@ export default class DeletePostModal extends React.Component {
|
|||||||
this.state.post.id,
|
this.state.post.id,
|
||||||
() => {
|
() => {
|
||||||
PostStore.deletePost(this.state.post);
|
PostStore.deletePost(this.state.post);
|
||||||
AsyncClient.getPosts(this.state.post.channel_id);
|
|
||||||
|
|
||||||
if (this.state.post.id === PostStore.getSelectedPostId()) {
|
if (this.state.post.id === PostStore.getSelectedPostId()) {
|
||||||
AppDispatcher.handleServerAction({
|
AppDispatcher.handleServerAction({
|
||||||
|
|||||||
@@ -147,7 +147,10 @@ export default class PostInfo extends React.Component {
|
|||||||
<a
|
<a
|
||||||
href='#'
|
href='#'
|
||||||
role='menuitem'
|
role='menuitem'
|
||||||
onClick={() => GlobalActions.showDeletePostModal(post, dataComments)}
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
GlobalActions.showDeletePostModal(post, dataComments);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='post_info.del'
|
id='post_info.del'
|
||||||
|
|||||||
@@ -200,7 +200,10 @@ export default class RhsComment extends React.Component {
|
|||||||
<a
|
<a
|
||||||
href='#'
|
href='#'
|
||||||
role='menuitem'
|
role='menuitem'
|
||||||
onClick={() => GlobalActions.showDeletePostModal(post, 0)}
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
GlobalActions.showDeletePostModal(post, 0);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='rhs_comment.del'
|
id='rhs_comment.del'
|
||||||
|
|||||||
@@ -216,6 +216,11 @@ class PostStoreClass extends EventEmitter {
|
|||||||
if (combinedPosts.order.indexOf(pid) === -1 && newPosts.order.indexOf(pid) !== -1) {
|
if (combinedPosts.order.indexOf(pid) === -1 && newPosts.order.indexOf(pid) !== -1) {
|
||||||
combinedPosts.order.push(pid);
|
combinedPosts.order.push(pid);
|
||||||
}
|
}
|
||||||
|
} else if (combinedPosts.posts.hasOwnProperty(pid)) {
|
||||||
|
combinedPosts.posts[pid] = Object.assign({}, np, {
|
||||||
|
state: Constants.POST_DELETED,
|
||||||
|
filenames: []
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user