From a43c6393dfcd7e408934d0f5c07fdfb2373128aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Tue, 16 Aug 2022 21:40:43 +0200 Subject: [PATCH] =?UTF-8?q?Kill=20a=20bug=20=F0=9F=90=9B=20Checking=20for?= =?UTF-8?q?=20`/api/data`=20to=20only=20load=20photos=20on=20client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Server would also load an api route, which… does not really exist --- src/routes/[country]/[location]/[photo]/+page.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/[country]/[location]/[photo]/+page.svelte b/src/routes/[country]/[location]/[photo]/+page.svelte index a8f3042..658a1d8 100644 --- a/src/routes/[country]/[location]/[photo]/+page.svelte +++ b/src/routes/[country]/[location]/[photo]/+page.svelte @@ -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) }