[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
Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-06-29 16:39:13 +02:00
коммит произвёл Harrison Healey
родитель 50b662040c
Коммит e1168ab7cc
2 изменённых файлов: 6 добавлений и 5 удалений

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

@@ -429,7 +429,7 @@
}, },
{ {
"id": "api.command.execute_command.not_found.app_error", "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", "id": "api.command.execute_command.save.app_error",

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

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