Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alextaing committed Nov 3, 2023
1 parent 8e5782d commit 42f24d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/pages/src/dev/server/ssr/getLocalData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ export const getLocalDataForEntityOrStaticPage = async ({
}: {
locale: string;
featureName: string;
entityId?: string;
entityId: string;
}) => {
const localData = await getLocalData((data) => {
const isEntityPage = !!entityId;
const isStatic = entityId === "";
const isMatchingEntity = !isStatic && entityId === data.id;
const matchesNameAndLocale =
data.locale === locale && data.__.name === featureName;
return isEntityPage
? matchesNameAndLocale && data.id === entityId
: matchesNameAndLocale;

return (isStatic || isMatchingEntity) && matchesNameAndLocale;
});
if (!localData) {
throw new Error(
Expand Down

0 comments on commit 42f24d6

Please sign in to comment.