Gracefully fail when there are no recents
This commit is contained in:
parent
8fbfd0fcb6
commit
443aba830f
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user