summaryrefslogtreecommitdiffstats
path: root/webapp/components/create_post.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/create_post.jsx')
-rw-r--r--webapp/components/create_post.jsx17
1 files changed, 4 insertions, 13 deletions
diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx
index 2ba79af36..f2b0a7631 100644
--- a/webapp/components/create_post.jsx
+++ b/webapp/components/create_post.jsx
@@ -11,7 +11,6 @@ import TutorialTip from './tutorial/tutorial_tip.jsx';
import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
-import Client from 'client/web_client.jsx';
import * as Utils from 'utils/utils.jsx';
import * as UserAgent from 'utils/user_agent.jsx';
import * as ChannelActions from 'actions/channel_actions.jsx';
@@ -158,24 +157,16 @@ export default class CreatePost extends React.Component {
GlobalActions.emitUserPostedEvent(post);
- Client.createPost(post,
- (data) => {
- PostStore.removePendingPost(post.pending_post_id);
-
- AppDispatcher.handleServerAction({
- type: ActionTypes.RECEIVED_POST,
- post: data
- });
+ PostActions.createPost(post, false,
+ () => {
+ // DO nothing.
},
(err) => {
if (err.id === 'api.post.create_post.root_id.app_error') {
// this should never actually happen since you can't reply from this textbox
this.showPostDeletedModal();
-
- PostStore.removePendingPost(post.pending_post_id);
} else {
- post.state = Constants.POST_FAILED;
- PostStore.updatePendingPost(post);
+ this.forceUpdate();
}
this.setState({