Clear post textbox as soon as a slash command is sent (#3789)

Этот коммит содержится в:
Harrison Healey
2016-08-12 07:41:17 -04:00
коммит произвёл Joram Wilander
родитель ea26a596b2
Коммит 96420542b1

Просмотреть файл

@@ -120,13 +120,15 @@ export default class CreatePost extends React.Component {
this.setState({submitting: true, serverError: null}); this.setState({submitting: true, serverError: null});
if (post.message.indexOf('/') === 0) { if (post.message.indexOf('/') === 0) {
PostStore.storeDraft(this.state.channelId, null);
this.setState({messageText: '', postError: null, previews: []});
ChannelActions.executeCommand( ChannelActions.executeCommand(
this.state.channelId, this.state.channelId,
post.message, post.message,
false, false,
(data) => { (data) => {
PostStore.storeDraft(this.state.channelId, null); this.setState({submitting: false});
this.setState({messageText: '', submitting: false, postError: null, previews: [], serverError: null});
if (data.goto_location && data.goto_location.length > 0) { if (data.goto_location && data.goto_location.length > 0) {
browserHistory.push(data.goto_location); browserHistory.push(data.goto_location);