Skip to content

Commit

Permalink
fix: remove cookie value from default locale state
Browse files Browse the repository at this point in the history
  • Loading branch information
janrembold committed Apr 24, 2024
1 parent 9c04d8b commit f09ab26
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/globalState/provider/LocaleProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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(() => {
Expand Down

0 comments on commit f09ab26

Please sign in to comment.