From c63b74a42d98c281b88996d1551df086ceffa68f Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 14 Jul 2021 14:13:04 +0300 Subject: [PATCH] Auth Phone Number: Allow any phone numbers (#1262) --- src/components/auth/AuthPhoneNumber.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/auth/AuthPhoneNumber.tsx b/src/components/auth/AuthPhoneNumber.tsx index a67e8b449..407457317 100644 --- a/src/components/auth/AuthPhoneNumber.tsx +++ b/src/components/auth/AuthPhoneNumber.tsx @@ -84,11 +84,15 @@ const AuthPhoneNumber: FC = ({ } const suggestedCountry = getCountryFromPhoneNumber(newFullNumber); - const selectedCountry = !country || (suggestedCountry && suggestedCountry.id !== country.id) + + // Any phone numbers should be allowed, in some cases ignoring formatting + const selectedCountry = !country + || (suggestedCountry && suggestedCountry.id !== country.id) + || (!suggestedCountry && newFullNumber.length) ? suggestedCountry : country; - if (!country || (selectedCountry && selectedCountry.code !== country.code)) { + if (!country || !selectedCountry || (selectedCountry && selectedCountry.code !== country.code)) { setCountry(selectedCountry); }