fix: prevent refetching country (#7622)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>pull/7623/head
parent
65687d6110
commit
d80581ad58
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue