mirror of https://github.com/zulip/zulip.git
refactor: Extract filter_persons.
This extraction will make sense in the next commit.
This commit is contained in:
parent
9ed5545abb
commit
c47fc36201
|
@ -485,7 +485,7 @@ exports.get_person_suggestions = function (query, opts) {
|
|||
return query_matches_name_description(query, item);
|
||||
};
|
||||
|
||||
const all_persons = people.get_realm_persons();
|
||||
function filter_persons(all_persons) {
|
||||
let persons;
|
||||
|
||||
if (opts.filter_pills) {
|
||||
|
@ -497,8 +497,11 @@ exports.get_person_suggestions = function (query, opts) {
|
|||
if (opts.want_broadcast) {
|
||||
persons = persons.concat(exports.broadcast_mentions());
|
||||
}
|
||||
return _.filter(persons, person_matcher);
|
||||
}
|
||||
|
||||
const filtered_persons = _.filter(persons, person_matcher);
|
||||
const all_persons = people.get_realm_persons();
|
||||
const filtered_persons = filter_persons(all_persons);
|
||||
|
||||
let groups;
|
||||
|
||||
|
|
Loading…
Reference in New Issue