Add dev-only debugging MoreComponents behavior

This commit is contained in:
Sam Becker 2024-01-16 13:24:46 -06:00
parent 0d892aad12
commit f15c8a4a5f
2 changed files with 8 additions and 1 deletions

View File

@ -19,6 +19,12 @@ export function MorePhotosLarge({
itemsPerRequest={itemsPerRequest}
getNextComponent={async (offset, limit) => {
'use server';
if (
process.env.NODE_ENV === 'development' &&
Math.random() < 0.95
) {
return { didFail: true };
}
const photos = await getPhotosCached({ limit: offset + limit })
.catch(() => undefined);
if (!photos) {

View File

@ -11,7 +11,8 @@ import {
import camelcaseKeys from 'camelcase-keys';
import type { Metadata } from 'next';
export const LARGE_PHOTOS_TO_SHOW = 12;
export const LARGE_PHOTOS_TO_SHOW =
process.env.NODE_ENV === 'development' ? 2 : 12;
export const GRID_THUMBNAILS_TO_SHOW_MAX = 12;
export const ACCEPTED_PHOTO_FILE_TYPES = [