summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
Diffstat (limited to 'webapp')
-rw-r--r--webapp/actions/post_actions.jsx5
-rw-r--r--webapp/components/delete_post_modal.jsx4
2 files changed, 7 insertions, 2 deletions
diff --git a/webapp/actions/post_actions.jsx b/webapp/actions/post_actions.jsx
index 207f0143d..0e48fb0e8 100644
--- a/webapp/actions/post_actions.jsx
+++ b/webapp/actions/post_actions.jsx
@@ -362,3 +362,8 @@ export function createPost(post, doLoadPost, success, error) {
}
);
}
+
+export function removePostFromStore(post) {
+ PostStore.removePost(post);
+ PostStore.emitChange();
+}
diff --git a/webapp/components/delete_post_modal.jsx b/webapp/components/delete_post_modal.jsx
index 5f21ea3bc..84eef4671 100644
--- a/webapp/components/delete_post_modal.jsx
+++ b/webapp/components/delete_post_modal.jsx
@@ -9,6 +9,7 @@ import ModalStore from 'stores/modal_store.jsx';
import {Modal} from 'react-bootstrap';
import * as AsyncClient from 'utils/async_client.jsx';
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
+import {removePostFromStore} from 'actions/post_actions.jsx';
import Constants from 'utils/constants.jsx';
import {FormattedMessage} from 'react-intl';
@@ -54,8 +55,7 @@ export default class DeletePostModal extends React.Component {
this.state.post.channel_id,
this.state.post.id,
() => {
- PostStore.deletePost(this.state.post);
-
+ removePostFromStore(this.state.post);
if (this.state.post.id === PostStore.getSelectedPostId()) {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_POST_SELECTED,