Skip to content

Commit

Permalink
fix: Resolve locale for navigation APIs consistently from config in `…
Browse files Browse the repository at this point in the history
…react-server` like all other APIs do
  • Loading branch information
amannn committed Oct 24, 2024
1 parent 5d60cdf commit 118e232
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Locales,
Pathnames
} from '../../routing/types';
import {getRequestLocale} from '../../server/react-server/RequestLocale';
import getConfig from '../../server/react-server/getConfig';
import createSharedNavigationFns from '../shared/createSharedNavigationFns';

export default function createNavigation<
Expand All @@ -35,7 +35,7 @@ export default function createNavigation<
type Locale = AppLocales extends never ? string : AppLocales[number];

function getLocale() {
return getRequestLocale() as Promise<Locale>;
return getConfig().then(({locale}) => locale) as Promise<Locale>;
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down

0 comments on commit 118e232

Please sign in to comment.