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