diff options
author | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2017-07-21 21:04:41 +0200 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-07-21 15:04:41 -0400 |
commit | 816bfbeb91b9cd64a8a85dc37cc0e82554409c14 (patch) | |
tree | d1069ec6ffa27b953bfe058d18fc0ca7ee7f6467 /webapp/components/create_post.jsx | |
parent | 10b7b96a2994382c82d3bc87b2d73c75671cea08 (diff) | |
download | chat-816bfbeb91b9cd64a8a85dc37cc0e82554409c14.tar.gz chat-816bfbeb91b9cd64a8a85dc37cc0e82554409c14.tar.bz2 chat-816bfbeb91b9cd64a8a85dc37cc0e82554409c14.zip |
[PLT-6708] /purpose [text] slash command: Edit the channel purpose (#6569)
* /purpose [text] slash command: Edit the channel purpose
* update command on server side to check for direct or group channels
* update stings and block the dialog when is DM or GM
* update per review
* remove duplicate websocker event and apply the same for /header command
* update per review
* update
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); } |