summaryrefslogtreecommitdiffstats
path: root/webapp/components/more_channels.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/more_channels.jsx')
-rw-r--r--webapp/components/more_channels.jsx9
1 files changed, 7 insertions, 2 deletions
diff --git a/webapp/components/more_channels.jsx b/webapp/components/more_channels.jsx
index e4cff451d..d0b5f5399 100644
--- a/webapp/components/more_channels.jsx
+++ b/webapp/components/more_channels.jsx
@@ -107,17 +107,22 @@ export default class MoreChannels extends React.Component {
clearTimeout(this.searchTimeoutId);
- this.searchTimeoutId = setTimeout(
+ const searchTimeoutId = setTimeout(
() => {
searchMoreChannels(
term,
(channels) => {
+ if (searchTimeoutId !== this.searchTimeoutId) {
+ return;
+ }
this.setState({search: true, channels});
}
);
},
SEARCH_TIMEOUT_MILLISECONDS
);
+
+ this.searchTimeoutId = searchTimeoutId;
}
render() {
@@ -196,4 +201,4 @@ export default class MoreChannels extends React.Component {
MoreChannels.propTypes = {
onModalDismissed: React.PropTypes.func,
handleNewChannel: React.PropTypes.func
-}; \ No newline at end of file
+};