Skip to content

Commit

Permalink
adding back removed condition
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Mar 15, 2023
1 parent 2ce9dc7 commit b4ec721
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,14 +766,14 @@ function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, ma

const isValidPhone = Str.isValidPhone(LoginUtils.appendCountryCode(searchValue));

if (searchValue && !isValidPhone) {
if (searchValue && CONST.REGEX.DIGITS_AND_PLUS.test(searchValue) && !isValidPhone) {
return Localize.translate(preferredLocale, 'messages.errorMessageInvalidPhone');
}

// Without a search value, it would be very confusing to see a search validation message.
// Therefore, this skips the validation when there is no search value.
if (searchValue && !hasSelectableOptions && !hasUserToInvite) {
if (!isValidPhone) {
if (/^\d+$/.test(searchValue) && !isValidPhone) {
return Localize.translate(preferredLocale, 'messages.errorMessageInvalidPhone');
}

Expand Down

0 comments on commit b4ec721

Please sign in to comment.