diff --git a/src/libs/LoginUtils.ts b/src/libs/LoginUtils.ts index 646bd00c35af..b900b6286edf 100644 --- a/src/libs/LoginUtils.ts +++ b/src/libs/LoginUtils.ts @@ -8,6 +8,8 @@ import {clearSignInData, setAccountError} from './actions/Session'; import Navigation from './Navigation/Navigation'; import {parsePhoneNumber} from './PhoneNumber'; +const PRIVATE_DOMAINS_SET = new Set(PUBLIC_DOMAINS); + let countryCodeByIP: number; Onyx.connect({ key: ONYXKEYS.COUNTRY_CODE, @@ -40,7 +42,7 @@ function appendCountryCode(phone: string): string { */ 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); } /**