mirror of https://github.com/zulip/zulip.git
people: Do not return undefined for is_cross_realm_email.
It would be semantically more straightfoward to return false when the check does not succeed. Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
parent
111f2f5e9d
commit
cd97c497bc
|
@ -943,7 +943,7 @@ export function get_non_active_realm_users() {
|
|||
export function is_cross_realm_email(email) {
|
||||
const person = get_by_email(email);
|
||||
if (!person) {
|
||||
return undefined;
|
||||
return false;
|
||||
}
|
||||
return cross_realm_dict.has(person.user_id);
|
||||
}
|
||||
|
|
|
@ -352,7 +352,7 @@ test_people("basics", () => {
|
|||
assert.equal(person.full_name, "Me Myself");
|
||||
|
||||
// Test undefined people
|
||||
assert.equal(people.is_cross_realm_email("unknown@example.com"), undefined);
|
||||
assert.equal(people.is_cross_realm_email("unknown@example.com"), false);
|
||||
|
||||
// Test is_my_user_id function
|
||||
assert.equal(people.is_my_user_id(me.user_id), true);
|
||||
|
|
Loading…
Reference in New Issue