Kill a bug 🐛 Checking for /api/data to only load photos on client

Server would also load an api route, which… does not really exist
This commit is contained in:
2022-08-16 21:40:43 +02:00
parent 0e6aaaa4e2
commit a43c6393df

View File

@@ -54,11 +54,11 @@
$: visiblePhotos = photos.slice(sliceStart, sliceStart + 7)
// Load previous photos
$: if (currentIndex === 0 && hasPrev) {
$: if (browser && currentIndex === 0 && hasPrev) {
loadPhotos(photos[0].id)
}
// Load next photos
$: if (currentIndex === photos.length - 5 && hasNext) {
$: if (browser && currentIndex === photos.length - 5 && hasNext) {
loadPhotos(photos[photos.length - 1].id, directions.NEXT)
}