fix: locales not using fallbackLocale in the admin UI and re-rendering issue when changing locales

This commit is contained in:
Paul Popus
2024-03-13 15:49:48 -03:00
parent b968d8594c
commit a9a61b2617
2 changed files with 5 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ export const Document: React.FC<AdminViewProps> = async ({
id, id,
collection: collectionSlug, collection: collectionSlug,
depth: 0, depth: 0,
fallbackLocale: null,
locale: locale.code, locale: locale.code,
overrideAccess: false, overrideAccess: false,
user, user,
@@ -148,6 +149,7 @@ export const Document: React.FC<AdminViewProps> = async ({
data = await payload.findGlobal({ data = await payload.findGlobal({
slug: globalSlug, slug: globalSlug,
depth: 0, depth: 0,
fallbackLocale: null,
locale: locale.code, locale: locale.code,
overrideAccess: false, overrideAccess: false,
user, user,

View File

@@ -21,6 +21,7 @@ export const ListView: React.FC<AdminViewProps> = async ({ initPageResult, searc
collectionConfig, collectionConfig,
permissions, permissions,
req: { req: {
locale,
payload, payload,
payload: { config }, payload: { config },
user, user,
@@ -76,7 +77,9 @@ export const ListView: React.FC<AdminViewProps> = async ({ initPageResult, searc
const data = await payload.find({ const data = await payload.find({
collection: collectionSlug, collection: collectionSlug,
depth: 0, depth: 0,
fallbackLocale: null,
limit, limit,
locale,
overrideAccess: false, overrideAccess: false,
user, user,
}) })