Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/libs/LoginUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import Navigation from './Navigation/Navigation';
import {parsePhoneNumber} from './PhoneNumber';

const PRIVATE_DOMAINS_SET = new Set(PUBLIC_DOMAINS);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was PUBLIC_DOMAINS -> PRIVATE_DOMAINS name change deliberate?

Suggested change
const PRIVATE_DOMAINS_SET = new Set(PUBLIC_DOMAINS);
const PUBLIC_DOMAINS_SET = new Set(PUBLIC_DOMAINS);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. I will update it


let countryCodeByIP: number;
Onyx.connect({
key: ONYXKEYS.COUNTRY_CODE,
Expand Down Expand Up @@ -40,7 +42,7 @@
*/
function isEmailPublicDomain(email: string): boolean {
const emailDomain = Str.extractEmailDomain(email).toLowerCase();
return (PUBLIC_DOMAINS as readonly string[]).includes(emailDomain);
return PRIVATE_DOMAINS_SET.has(emailDomain);

Check failure on line 45 in src/libs/LoginUtils.ts

View workflow job for this annotation

GitHub Actions / typecheck

Argument of type 'string' is not assignable to parameter of type '"accountant.com" | "afis.ch" | "aol.com" | "artlover.com" | "asia.com" | "att.net" | "bellsouth.net" | "bills.expensify.com" | "btinternet.com" | "cheerful.com" | "chromeexpensify.com" | ... 59 more ... | "ymail.com"'.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might have to cast the type here

}

/**
Expand Down
Loading