From 96420542b193defc6a562d2151acf113ef93b87f Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Fri, 12 Aug 2016 07:41:17 -0400 Subject: Clear post textbox as soon as a slash command is sent (#3789) --- webapp/components/create_post.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx index 0c2b8d644..c9b796107 100644 --- a/webapp/components/create_post.jsx +++ b/webapp/components/create_post.jsx @@ -120,13 +120,15 @@ export default class CreatePost extends React.Component { this.setState({submitting: true, serverError: null}); if (post.message.indexOf('/') === 0) { + PostStore.storeDraft(this.state.channelId, null); + this.setState({messageText: '', postError: null, previews: []}); + ChannelActions.executeCommand( this.state.channelId, post.message, false, (data) => { - PostStore.storeDraft(this.state.channelId, null); - this.setState({messageText: '', submitting: false, postError: null, previews: [], serverError: null}); + this.setState({submitting: false}); if (data.goto_location && data.goto_location.length > 0) { browserHistory.push(data.goto_location); -- cgit v1.2.3-1-g7c22