From f09ab26b45b572c794719d716f6575beaf843e2b Mon Sep 17 00:00:00 2001 From: janrembold Date: Wed, 24 Apr 2024 13:07:44 +0200 Subject: [PATCH] fix: remove cookie value from default locale state --- src/globalState/provider/LocaleProvider.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/globalState/provider/LocaleProvider.tsx b/src/globalState/provider/LocaleProvider.tsx index 05fffae72..3d3f6133f 100644 --- a/src/globalState/provider/LocaleProvider.tsx +++ b/src/globalState/provider/LocaleProvider.tsx @@ -3,10 +3,7 @@ import { useContext, useEffect, useMemo, useState } from 'react'; import i18n, { FALLBACK_LNG, init } from '../../i18n'; import { InformalContext } from './InformalProvider'; import { useAppConfig } from '../../hooks/useAppConfig'; -import { - getValueFromCookie, - setValueInCookie -} from '../../components/sessionCookie/accessSessionCookie'; +import { setValueInCookie } from '../../components/sessionCookie/accessSessionCookie'; import { useTenant } from './TenantProvider'; import useTenantTheming from '../../utils/useTenantTheming'; import { LocaleContext, TLocaleContext } from '../context/LocaleContext'; @@ -22,9 +19,7 @@ export function LocaleProvider(props) { const { informal } = useContext(InformalContext); const [locales, setLocales] = useState([]); const [locale, setLocale] = useState( - getValueFromCookie('lang') || - localStorage.getItem(STORAGE_KEY_LOCALE) || - null + localStorage.getItem(STORAGE_KEY_LOCALE) || null ); useEffect(() => {