Skip to content

Commit

Permalink
b - dublerer onLanguageSelect
Browse files Browse the repository at this point in the history
Heller én for mye enn én for lite
  • Loading branch information
toresbe committed Nov 21, 2024
1 parent a7bc744 commit 4c7d3b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import "./lib/i18n/reacti18Next.ts";
import {getPathPrefixIncludingLocale} from "./getPathPrefixIncludingLocale.ts";
import {QueryClient, QueryClientProvider} from "@tanstack/react-query";
import {ReactQueryDevtools} from "@tanstack/react-query-devtools";
import {onLanguageSelect, setParams} from "@navikt/nav-dekoratoren-moduler";

const queryClient = new QueryClient();

Expand All @@ -44,7 +45,10 @@ export default function App() {
};
}

const {prefix} = getPathPrefixIncludingLocale();
const {prefix, path} = getPathPrefixIncludingLocale();
onLanguageSelect(({locale: language, url}) =>
setParams({language}).then(() => window.location.assign(`${url}${path}`))
);
return (
<Suspense fallback={<ApplicationSpinner />}>
<QueryClientProvider client={queryClient}>
Expand Down

0 comments on commit 4c7d3b1

Please sign in to comment.