diff --git a/src/pages/settings/Profile/Contacts/NewContactMethodPage.js b/src/pages/settings/Profile/Contacts/NewContactMethodPage.js index 8a85c6857661..60f26cd309d8 100644 --- a/src/pages/settings/Profile/Contacts/NewContactMethodPage.js +++ b/src/pages/settings/Profile/Contacts/NewContactMethodPage.js @@ -65,7 +65,7 @@ const getPhoneLogin = (phoneOrEmail) => { const validateNumber = (values) => { const parsedPhoneNumber = parsePhoneNumber(values); - if (parsedPhoneNumber.possible) { + if (parsedPhoneNumber.possible && Str.isValidPhone(values.slice(0))) { return parsedPhoneNumber.number.e164 + CONST.SMS.DOMAIN; } @@ -94,7 +94,7 @@ function NewContactMethodPage(props) { ErrorUtils.addErrorMessage(errors, 'phoneOrEmail', 'contacts.genericFailureMessages.contactMethodRequired'); } - if (!_.isEmpty(values.phoneOrEmail) && !((parsePhoneNumber(phoneLogin).possible && Str.isValidPhone(phoneLogin.slice(0))) || Str.isValidEmail(values.phoneOrEmail))) { + if (!_.isEmpty(values.phoneOrEmail) && !(validateIfnumber || Str.isValidEmail(values.phoneOrEmail))) { ErrorUtils.addErrorMessage(errors, 'phoneOrEmail', 'contacts.genericFailureMessages.invalidContactMethod'); }