summaryrefslogtreecommitdiffstats
path: root/webapp/components
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components')
-rw-r--r--webapp/components/create_post.jsx6
-rw-r--r--webapp/components/navbar.jsx6
2 files changed, 9 insertions, 3 deletions
diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx
index 328f182a3..e5ead4e84 100644
--- a/webapp/components/create_post.jsx
+++ b/webapp/components/create_post.jsx
@@ -243,6 +243,12 @@ export default class CreatePost extends React.Component {
return;
}
+ if (!isDirectOrGroup && this.state.message.trimRight() === '/rename') {
+ GlobalActions.showChannelNameUpdateModal(updateChannel);
+ this.setState({message: ''});
+ return;
+ }
+
this.doSubmit(e);
}
diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx
index fc2ade7ab..81959f352 100644
--- a/webapp/components/navbar.jsx
+++ b/webapp/components/navbar.jsx
@@ -115,6 +115,7 @@ export default class Navbar extends React.Component {
ModalStore.addModalListener(ActionTypes.TOGGLE_QUICK_SWITCH_MODAL, this.toggleQuickSwitchModal);
ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_HEADER_UPDATE_MODAL, this.showEditChannelHeaderModal);
ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_PURPOSE_UPDATE_MODAL, this.showChannelPurposeModal);
+ ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_NAME_UPDATE_MODAL, this.showRenameChannelModal);
$('.inner-wrap').click(this.hideSidebars);
document.addEventListener('keydown', this.handleQuickSwitchKeyPress);
}
@@ -128,6 +129,7 @@ export default class Navbar extends React.Component {
ModalStore.removeModalListener(ActionTypes.TOGGLE_QUICK_SWITCH_MODAL, this.toggleQuickSwitchModal);
ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_HEADER_UPDATE_MODAL, this.hideEditChannelHeaderModal);
ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_PURPOSE_UPDATE_MODAL, this.hideChannelPurposeModal);
+ ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_NAME_UPDATE_MODAL, this.hideRenameChannelModal);
document.removeEventListener('keydown', this.handleQuickSwitchKeyPress);
}
@@ -218,9 +220,7 @@ export default class Navbar extends React.Component {
});
}
- showRenameChannelModal(e) {
- e.preventDefault();
-
+ showRenameChannelModal() {
this.setState({
showRenameChannelModal: true
});