summaryrefslogtreecommitdiffstats
path: root/webapp/components/channel_switch_modal.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-10-20 11:32:20 -0400
committerenahum <nahumhbl@gmail.com>2016-10-20 12:32:20 -0300
commit4aa96c76b4662d6d7f9a28af0b719404c31bbb45 (patch)
treebc8f8ccc2ba7674e7377c9fe963386d0ca9b94df /webapp/components/channel_switch_modal.jsx
parent4688d4981a2b9f190b94c0932e8c12e15fd98ebe (diff)
downloadchat-4aa96c76b4662d6d7f9a28af0b719404c31bbb45.tar.gz
chat-4aa96c76b4662d6d7f9a28af0b719404c31bbb45.tar.bz2
chat-4aa96c76b4662d6d7f9a28af0b719404c31bbb45.zip
Fix autocomplete for old mechanisms and add partial fix for channel switcher (#4279)
Diffstat (limited to 'webapp/components/channel_switch_modal.jsx')
-rw-r--r--webapp/components/channel_switch_modal.jsx8
1 files changed, 8 insertions, 0 deletions
diff --git a/webapp/components/channel_switch_modal.jsx b/webapp/components/channel_switch_modal.jsx
index 7d15a9c45..17193d196 100644
--- a/webapp/components/channel_switch_modal.jsx
+++ b/webapp/components/channel_switch_modal.jsx
@@ -18,6 +18,7 @@ import * as Utils from 'utils/utils.jsx';
import React from 'react';
import $ from 'jquery';
+
export default class SwitchChannelModal extends React.Component {
constructor() {
super();
@@ -28,6 +29,8 @@ export default class SwitchChannelModal extends React.Component {
this.onExited = this.onExited.bind(this);
this.handleKeyDown = this.handleKeyDown.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
+ this.switchToChannel = this.switchToChannel.bind(this);
+
this.suggestionProviders = [new SwitchChannelProvider()];
this.state = {
@@ -92,16 +95,21 @@ export default class SwitchChannelModal extends React.Component {
user,
(ch) => {
channel = ch;
+ this.switchToChannel(channel);
},
() => {
channel = null;
+ this.switchToChannel(channel);
}
);
}
} else {
channel = ChannelStore.getByName(this.state.text.trim());
+ this.switchToChannel(channel);
}
+ }
+ switchToChannel(channel) {
if (channel !== null) {
goToChannel(channel);
this.onHide();