-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #894 from frontendnetwork/feat/UpgradeFixes
fix: Change from experimental use cache to use server for stability
- Loading branch information
Showing
4 changed files
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
"use server"; | ||
"use cache"; | ||
|
||
import Veganify from "@frontendnetwork/veganify"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
"use server"; | ||
"use cache"; | ||
|
||
import Veganify from "@frontendnetwork/veganify"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
import { notFound } from "next/navigation"; | ||
import { getRequestConfig } from "next-intl/server"; | ||
|
||
import { routing } from "./routing"; | ||
|
||
export default getRequestConfig(async ({ locale }: { locale: string }) => { | ||
// Validate that the incoming `locale` parameter is valid | ||
if (!routing.locales.includes(locale as (typeof routing.locales)[number])) { | ||
notFound(); | ||
export default getRequestConfig(async ({ requestLocale }) => { | ||
let locale = await requestLocale; | ||
|
||
if ( | ||
!locale || | ||
!routing.locales.includes(locale as (typeof routing.locales)[number]) | ||
) { | ||
locale = routing.defaultLocale; | ||
} | ||
|
||
return { | ||
locale, | ||
messages: (await import(`../locales/${locale}.json`)).default, | ||
}; | ||
}); |