Gracefully fail when there are no recents

This commit is contained in:
Sam Becker 2025-07-11 23:12:27 -05:00
parent 8fbfd0fcb6
commit 443aba830f
2 changed files with 5 additions and 5 deletions

View File

@ -39,10 +39,11 @@ export const NULL_CATEGORY_DATA: CategoryData = {
export const getDataForCategories = () => Promise.all([
SHOW_RECENTS
? getPhotosMeta({ recent: true })
.then(({ count, dateRange }) => [{
.then(({ count, dateRange }) => count && dateRange
? [{
count,
lastModified: new Date(dateRange?.end ?? ''),
}])
}] : undefined)
.catch(() => [])
: undefined,
SHOW_YEARS

View File

@ -20,7 +20,6 @@ export default function ResponsiveText({
const textLength = typeof children === 'string'
? children.length
: 0;
console.log(textLength);
return textLength >= CHARACTER_CUTOFF_LG
? { short: 'lg:hidden', long: 'max-lg:hidden' }
: textLength >= CHARACTER_CUTOFF_MD