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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user