Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

typeahead [nfc]: Dedupe query_matches_person logic a bit.

Greg Price28c97dd4f1ad
diff --git a/static/js/composebox_typeahead.js b/static/js/composebox_typeahead.js
index 38e0e911d6c..46903e25e8d 100644
--- a/static/js/composebox_typeahead.js
+++ b/static/js/composebox_typeahead.js
@@ -86,12 +86,10 @@ function get_language_matcher(query) {
}
export function query_matches_person(query, person) {
- if (!settings_data.show_email()) {
- return typeahead.query_matches_string(query, person.full_name, " ");
- }
return (
typeahead.query_matches_string(query, person.full_name, " ") ||
- typeahead.query_matches_string(query, people.get_visible_email(person), " ")
+ (settings_data.show_email() &&
+ typeahead.query_matches_string(query, people.get_visible_email(person), " "))
);
}