fix: prevent refetching country (#7622)

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
pull/7623/head
Udit Takkar 2023-03-09 16:08:57 +05:30 committed by GitHub
parent 65687d6110
commit d80581ad58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -36,7 +36,10 @@ function PhoneInput({ name, className = "", onChange, ...rest }: PhoneInputProps
const useDefaultCountry = () => {
const [defaultCountry, setDefaultCountry] = useState<Country>("US");
const query = trpc.viewer.public.countryCode.useQuery(undefined, {
trpc.viewer.public.countryCode.useQuery(undefined, {
refetchOnWindowFocus: false,
refetchOnReconnect: false,
retry: false,
onSuccess: (data) => {
if (isSupportedCountry(data?.countryCode)) {
setDefaultCountry(data.countryCode as Country);