From e1168ab7cc9770ab71fda6994ee80ef0e64e15d7 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Thu, 29 Jun 2017 16:39:13 +0200 Subject: [PATCH] [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 --- i18n/en.json | 2 +- webapp/components/create_post.jsx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/i18n/en.json b/i18n/en.json index ff34cf54f5..807612d32f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -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", diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx index 4587f3a907..e7fafc5147 100644 --- a/webapp/components/create_post.jsx +++ b/webapp/components/create_post.jsx @@ -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 + }); } } );