Skip to content

Commit

Permalink
🚸 sett språk ved første render så riktig språk blir valgt i dekoratøren
Browse files Browse the repository at this point in the history
  • Loading branch information
tidnav committed Aug 22, 2024
1 parent 6a388b8 commit 990baa8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { initializeFaro } from '@grafana/faro-web-sdk';
import '@navikt/ds-css';
import { DecoratorLocale } from '@navikt/nav-dekoratoren-moduler';
import {DecoratorLocale, setParams} from '@navikt/nav-dekoratoren-moduler';
import type { AppProps } from 'next/app';
import Head from 'next/head';
import { useRouter } from 'next/router';
Expand Down Expand Up @@ -58,6 +58,9 @@ function MyApp({ Component, pageProps }: AppProps) {
const [browserState, setBrowserState] = useState<BrowserInterface>({
redirect: false,
});
useEffect(() => {
setParams({language: locale as DecoratorLocale})
}, []);

useEffect(() => {
if (process.env.NEXT_PUBLIC_FARO_URL) {
Expand Down

0 comments on commit 990baa8

Please sign in to comment.