Compare commits

...

1 Commits

Author SHA1 Message Date
zomars 826a7255f0 hotfix: direction undefined for locale 2023-10-16 14:23:48 +01:00
1 changed files with 0 additions and 19 deletions

View File

@ -8,7 +8,6 @@ import { ThemeProvider } from "next-themes";
import type { AppProps as NextAppProps, AppProps as NextJsAppProps } from "next/app";
import type { ParsedUrlQuery } from "querystring";
import type { PropsWithChildren, ReactNode } from "react";
import { useEffect } from "react";
import { OrgBrandingProvider } from "@calcom/features/ee/organizations/context/provider";
import DynamicHelpscoutProvider from "@calcom/features/ee/support/lib/helpscout/providerDynamic";
@ -75,23 +74,6 @@ const CustomI18nextProvider = (props: AppPropsWithoutNonce) => {
const session = useSession();
const locale = session?.data?.user.locale ?? props.pageProps.newLocale;
useEffect(() => {
window.document.documentElement.lang = locale;
let direction = window.document.dir || "ltr";
try {
const intlLocale = new Intl.Locale(locale);
// @ts-expect-error INFO: Typescript does not know about the Intl.Locale textInfo attribute
direction = intlLocale.textInfo?.direction;
} catch (error) {
console.error(error);
}
window.document.dir = direction;
}, [locale]);
const clientViewerI18n = useViewerI18n(locale);
const i18n = clientViewerI18n.data?.i18n;
@ -99,7 +81,6 @@ const CustomI18nextProvider = (props: AppPropsWithoutNonce) => {
...props,
pageProps: {
...props.pageProps,
...i18n,
},
};