summaryrefslogtreecommitdiffstats
path: root/webapp/components/create_post.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-08-12 07:41:17 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-08-12 07:41:17 -0400
commit96420542b193defc6a562d2151acf113ef93b87f (patch)
tree09a88a1259e7c048a08d02b7bf0005e5f769d127 /webapp/components/create_post.jsx
parentea26a596b21f1781263f32662566abc89a38cf83 (diff)
downloadchat-96420542b193defc6a562d2151acf113ef93b87f.tar.gz
chat-96420542b193defc6a562d2151acf113ef93b87f.tar.bz2
chat-96420542b193defc6a562d2151acf113ef93b87f.zip
Clear post textbox as soon as a slash command is sent (#3789)
Diffstat (limited to 'webapp/components/create_post.jsx')
-rw-r--r--webapp/components/create_post.jsx6
1 files changed, 4 insertions, 2 deletions
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);