Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
people: Don't refetch user when we already have it.
evykassireraf8263fb871a
diff --git a/web/src/people.ts b/web/src/people.tsindex 8062e73fc5a..dbb3f4539dd 100644--- a/web/src/people.ts+++ b/web/src/people.ts@@ -1234,17 +1234,11 @@ export function filter_people_by_search_terms(// Loop through users and populate filtered_users only// if they include search_termsfor (const user of users) {- const person = get_by_email(user.email);- // Get person object (and ignore errors)- if (!person?.full_name) {- continue;- }-// Return user emails that include search termsconst match = matchers.some((matcher) => matcher(user));if (match) {- filtered_users.set(person.user_id, true);+ filtered_users.set(user.user_id, true);}}diff --git a/web/tests/people.test.js b/web/tests/people.test.jsindex c54042719c4..c625618dcd8 100644--- a/web/tests/people.test.js+++ b/web/tests/people.test.js@@ -758,13 +758,6 @@ test_people("filtered_users", () => {filtered_people = people.filter_people_by_search_terms(users, ["ëm"]);assert.equal(filtered_people.size, 1);assert.ok(filtered_people.has(noah.user_id));-- // Test filtering with undefined user- users.push(invalid_user);-- filtered_people = people.filter_people_by_search_terms(users, ["ltorv"]);- assert.equal(filtered_people.size, 1);- assert.ok(filtered_people.has(linus.user_id));});test_people("multi_user_methods", () => {