[PLT-6847] If a message starts with a / but is not a slash command, put the text back in the input box when it fails to send (#6695)

* If a message starts with a / but is not a slash command, put the text back in the input box when it fails to send

* update string per review

* update per review
This commit is contained in:
Carlos Tadeu Panato Junior
2017-06-29 16:39:13 +02:00
committed by Harrison Healey
parent 50b662040c
commit e1168ab7cc
2 changed files with 6 additions and 5 deletions

View File

@@ -429,7 +429,7 @@
},
{
"id": "api.command.execute_command.not_found.app_error",
"translation": "Command with a trigger of '{{.Trigger}}' not found"
"translation": "Command with a trigger of '{{.Trigger}}' not found. To send a message beginning with \"/\", try adding an empty space at the beginning of the message."
},
{
"id": "api.command.execute_command.save.app_error",

View File

@@ -170,10 +170,11 @@ export default class CreatePost extends React.Component {
if (err.sendMessage) {
this.sendMessage(post);
} else {
const state = {};
state.serverError = err.message;
state.submitting = false;
this.setState({state});
this.setState({
serverError: err.message,
submitting: false,
message: post.message
});
}
}
);