summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webapp/components/create_comment.jsx7
-rw-r--r--webapp/components/create_post.jsx7
2 files changed, 12 insertions, 2 deletions
diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx
index 85f8ac864..f7564f396 100644
--- a/webapp/components/create_comment.jsx
+++ b/webapp/components/create_comment.jsx
@@ -146,8 +146,13 @@ class CreateComment extends React.Component {
GlobalActions.emitUserCommentedEvent(post);
Client.createPost(
post,
- () => {
+ (data) => {
PostStore.removePendingPost(post.channel_id, post.pending_post_id);
+
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECEIVED_POST,
+ post: data
+ });
},
(err) => {
if (err.id === 'api.post.create_post.root_id.app_error') {
diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx
index eedae8571..4e88a538f 100644
--- a/webapp/components/create_post.jsx
+++ b/webapp/components/create_post.jsx
@@ -179,8 +179,13 @@ class CreatePost extends React.Component {
this.setState({messageText: '', submitting: false, postError: null, previews: [], serverError: null});
Client.createPost(post,
- () => {
+ (data) => {
PostStore.removePendingPost(post.pending_post_id);
+
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECEIVED_POST,
+ post: data
+ });
},
(err) => {
if (err.id === 'api.post.create_post.root_id.app_error') {