Rename home constant

This commit is contained in:
Sam Becker 2024-02-25 10:52:49 -06:00
parent 6e90eda992
commit 31e5e263cf
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
import { getPhotosCached, getPhotosCountCached } from '@/photo/cache'; import { getPhotosCached, getPhotosCountCached } from '@/photo/cache';
import { import {
INFINITE_SCROLL_MULTIPLE_ROOT, INFINITE_SCROLL_MULTIPLE_HOME,
generateOgImageMetaForPhotos, generateOgImageMetaForPhotos,
} from '@/photo'; } from '@/photo';
import PhotosEmptyState from '@/photo/PhotosEmptyState'; import PhotosEmptyState from '@/photo/PhotosEmptyState';
@ -25,7 +25,7 @@ export default async function HomePage() {
count, count,
] = await Promise.all([ ] = await Promise.all([
// Make homepage queries resilient to error on first time setup // Make homepage queries resilient to error on first time setup
getPhotosCached({ limit: INFINITE_SCROLL_MULTIPLE_ROOT }).catch(() => []), getPhotosCached({ limit: INFINITE_SCROLL_MULTIPLE_HOME }).catch(() => []),
getPhotosCountCached().catch(() => 0), getPhotosCountCached().catch(() => 0),
]); ]);
@ -35,8 +35,8 @@ export default async function HomePage() {
<PhotosLarge photos={photos} /> <PhotosLarge photos={photos} />
<Suspense> <Suspense>
<MorePhotosRoot <MorePhotosRoot
initialOffset={INFINITE_SCROLL_MULTIPLE_ROOT} initialOffset={INFINITE_SCROLL_MULTIPLE_HOME}
itemsPerRequest={INFINITE_SCROLL_MULTIPLE_ROOT} itemsPerRequest={INFINITE_SCROLL_MULTIPLE_HOME}
totalPhotosCount={count} totalPhotosCount={count}
/> />
</Suspense> </Suspense>

View File

@ -14,7 +14,7 @@ import type { Metadata } from 'next';
export const GENERATE_STATIC_PARAMS_LIMIT = 1000; export const GENERATE_STATIC_PARAMS_LIMIT = 1000;
export const INFINITE_SCROLL_MULTIPLE_ROOT = export const INFINITE_SCROLL_MULTIPLE_HOME =
process.env.NODE_ENV === 'development' ? 2 : 12; process.env.NODE_ENV === 'development' ? 2 : 12;
export const INFINITE_SCROLL_MULTIPLE_GRID = HIGH_DENSITY_GRID export const INFINITE_SCROLL_MULTIPLE_GRID = HIGH_DENSITY_GRID
? process.env.NODE_ENV === 'development' ? 4 : 20 ? process.env.NODE_ENV === 'development' ? 4 : 20