Check for when there are no photos
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
let currentPage: number = 1
|
||||
let ended: boolean
|
||||
let currentPhotosAmount: number
|
||||
$: latestPhoto = photos[0]
|
||||
$: currentPhotosAmount = photos.length
|
||||
$: ended = currentPhotosAmount === totalPhotos
|
||||
|
||||
@@ -120,12 +121,14 @@
|
||||
{/if}
|
||||
{/each}
|
||||
</p>
|
||||
·
|
||||
<p class="text-label" title={dayjs(photos[0].date_created).format('DD/MM/YYYY, hh:mm')}>
|
||||
Updated <time datetime={dayjs(photos[0].date_created).format('YYYY-MM-DD')}>
|
||||
{dayjs().to(dayjs(photos[0].date_created))}
|
||||
</time>
|
||||
</p>
|
||||
{#if latestPhoto}
|
||||
·
|
||||
<p class="text-label" title={dayjs(latestPhoto.date_created).format('DD/MM/YYYY, hh:mm')}>
|
||||
Updated <time datetime={dayjs(latestPhoto.date_created).format('YYYY-MM-DD')}>
|
||||
{dayjs().to(dayjs(latestPhoto.date_created))}
|
||||
</time>
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="ctas">
|
||||
@@ -258,8 +261,8 @@
|
||||
props: {
|
||||
data: data.location[0],
|
||||
photos: data.photos,
|
||||
totalPhotos: locationPhotosCount.count.id,
|
||||
lastUpdated: data.photos[0].date_created,
|
||||
totalPhotos: data.photos.length ? locationPhotosCount.count.id : 0,
|
||||
lastUpdated: data.photos.length ? data.photos[0].date_created : undefined,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user