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 {
INFINITE_SCROLL_MULTIPLE_ROOT,
INFINITE_SCROLL_MULTIPLE_HOME,
generateOgImageMetaForPhotos,
} from '@/photo';
import PhotosEmptyState from '@/photo/PhotosEmptyState';
@ -25,7 +25,7 @@ export default async function HomePage() {
count,
] = await Promise.all([
// 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),
]);
@ -35,8 +35,8 @@ export default async function HomePage() {
<PhotosLarge photos={photos} />
<Suspense>
<MorePhotosRoot
initialOffset={INFINITE_SCROLL_MULTIPLE_ROOT}
itemsPerRequest={INFINITE_SCROLL_MULTIPLE_ROOT}
initialOffset={INFINITE_SCROLL_MULTIPLE_HOME}
itemsPerRequest={INFINITE_SCROLL_MULTIPLE_HOME}
totalPhotosCount={count}
/>
</Suspense>

View File

@ -14,7 +14,7 @@ import type { Metadata } from 'next';
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;
export const INFINITE_SCROLL_MULTIPLE_GRID = HIGH_DENSITY_GRID
? process.env.NODE_ENV === 'development' ? 4 : 20