Merge pull request #1963 from hmhealey/plt1670

PLT-1670 Added a limit to the number of suggestions when autocompleting at mentions
Этот коммит содержится в:
Joram Wilander
2016-01-25 07:27:15 -05:00
родитель a401b9f942 43c19981cf
Коммит 4db80803aa

Просмотреть файл

@@ -5,6 +5,8 @@ import SuggestionStore from '../../stores/suggestion_store.jsx';
import UserStore from '../../stores/user_store.jsx';
import * as Utils from '../../utils/utils.jsx';
const MaxUserSuggestions = 40;
class AtMentionSuggestion extends React.Component {
render() {
const {item, isSelection, onClick} = this.props;
@@ -78,6 +80,10 @@ export default class AtMentionProvider {
if (user.username.startsWith(usernamePrefix)) {
filtered.push(user);
}
if (filtered.length >= MaxUserSuggestions) {
break;
}
}
// add dummy users to represent the @all and @channel special mentions