Added a limit to the number of suggestions when autocompleting at mentions

Этот коммит содержится в:
hmhealey
2016-01-23 12:15:28 -05:00
родитель 1a0b12313b
Коммит 43c19981cf

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

@@ -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