From 826a7255f07f861a13eadbd97ad829b6f0565252 Mon Sep 17 00:00:00 2001 From: zomars Date: Sat, 14 Oct 2023 15:53:27 -0700 Subject: [PATCH] hotfix: direction undefined for locale --- apps/web/lib/app-providers.tsx | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/apps/web/lib/app-providers.tsx b/apps/web/lib/app-providers.tsx index 51d3bfd0ea..973f9f55c1 100644 --- a/apps/web/lib/app-providers.tsx +++ b/apps/web/lib/app-providers.tsx @@ -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, }, };