chore: bump @trpc/* and @tanstack/react-query (#13335)
Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Omar López <[email protected]> Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: Alex van Andel <[email protected]> Co-authored-by: zomars <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Benny Joo <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: Gergő Móricz <[email protected]> Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
183 files changed
+1203
-1013
No files matched your search
@@ -68,11 +68,15 @@ function BasePhoneInput({ name, className = "", onChange, ...rest }: PhoneInputP
|
||||
|
||||
const useDefaultCountry = () => {
|
||||
const [defaultCountry, setDefaultCountry] = useState("us");
|
||||
trpc.viewer.public.countryCode.useQuery(undefined, {
|
||||
const query = trpc.viewer.public.countryCode.useQuery(undefined, {
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
retry: false,
|
||||
onSuccess: (data) => {
|
||||
});
|
||||
|
||||
useEffect(
|
||||
function refactorMeWithoutEffect() {
|
||||
const data = query.data;
|
||||
if (!data?.countryCode) {
|
||||
return;
|
||||
}
|
||||
@@ -81,7 +85,8 @@ const useDefaultCountry = () => {
|
||||
? setDefaultCountry(data.countryCode.toLowerCase())
|
||||
: setDefaultCountry(navigator.language.split("-")[1]?.toLowerCase() || "us");
|
||||
},
|
||||
});
|
||||
[query.data]
|
||||
);
|
||||
|
||||
return defaultCountry;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user