diff options
Diffstat (limited to 'webapp/components/create_post.jsx')
-rw-r--r-- | webapp/components/create_post.jsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx index f2f4d7e39..32f812aa3 100644 --- a/webapp/components/create_post.jsx +++ b/webapp/components/create_post.jsx @@ -227,12 +227,19 @@ export default class CreatePost extends React.Component { return; } - if (this.state.message.endsWith('/header ')) { + if (this.state.message.trimRight() === '/header') { GlobalActions.showChannelHeaderUpdateModal(updateChannel); this.setState({message: ''}); return; } + const isDirectOrGroup = ((updateChannel.type === Constants.DM_CHANNEL) || (updateChannel.type === Constants.GM_CHANNEL)); + if (!isDirectOrGroup && this.state.message.trimRight() === '/purpose') { + GlobalActions.showChannelPurposeUpdateModal(updateChannel); + this.setState({message: ''}); + return; + } + this.doSubmit(e); } |