Add dev-only debugging MoreComponents behavior
This commit is contained in:
parent
0d892aad12
commit
f15c8a4a5f
@ -19,6 +19,12 @@ export function MorePhotosLarge({
|
|||||||
itemsPerRequest={itemsPerRequest}
|
itemsPerRequest={itemsPerRequest}
|
||||||
getNextComponent={async (offset, limit) => {
|
getNextComponent={async (offset, limit) => {
|
||||||
'use server';
|
'use server';
|
||||||
|
if (
|
||||||
|
process.env.NODE_ENV === 'development' &&
|
||||||
|
Math.random() < 0.95
|
||||||
|
) {
|
||||||
|
return { didFail: true };
|
||||||
|
}
|
||||||
const photos = await getPhotosCached({ limit: offset + limit })
|
const photos = await getPhotosCached({ limit: offset + limit })
|
||||||
.catch(() => undefined);
|
.catch(() => undefined);
|
||||||
if (!photos) {
|
if (!photos) {
|
||||||
|
|||||||
@ -11,7 +11,8 @@ import {
|
|||||||
import camelcaseKeys from 'camelcase-keys';
|
import camelcaseKeys from 'camelcase-keys';
|
||||||
import type { Metadata } from 'next';
|
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 GRID_THUMBNAILS_TO_SHOW_MAX = 12;
|
||||||
|
|
||||||
export const ACCEPTED_PHOTO_FILE_TYPES = [
|
export const ACCEPTED_PHOTO_FILE_TYPES = [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user