From 5952a38ab9b977e031c0d08f2cac264b0f03077a Mon Sep 17 00:00:00 2001 From: "GitStart-Cal.com" <121884634+gitstart-calcom@users.noreply.github.com> Date: Thu, 22 Jun 2023 16:18:05 +0800 Subject: [PATCH] feat: [CAL-910] Pre-select country for phone number (CALCOM-5759) (#9526) Co-authored-by: gitstart-calcom --- packages/ui/form/PhoneInput.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ui/form/PhoneInput.tsx b/packages/ui/form/PhoneInput.tsx index 59466430b6..d29df98a33 100644 --- a/packages/ui/form/PhoneInput.tsx +++ b/packages/ui/form/PhoneInput.tsx @@ -64,9 +64,9 @@ const useDefaultCountry = () => { refetchOnReconnect: false, retry: false, onSuccess: (data) => { - if (isSupportedCountry(data?.countryCode)) { - setDefaultCountry(data.countryCode.toLowerCase()); - } + isSupportedCountry(data?.countryCode) + ? setDefaultCountry(data.countryCode.toLowerCase()) + : setDefaultCountry(navigator.language.split("-")[1]?.toLowerCase() || "us"); }, });