From 9f6bf8d97a961be0a02b3db0c7461161b4341d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Wed, 31 Aug 2022 18:35:46 +0200 Subject: [PATCH] Fix Photos page data reactivity and IntersectionObserver rootmargin --- src/routes/photos/+page.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/routes/photos/+page.svelte b/src/routes/photos/+page.svelte index dc7ce4d..efc4ba4 100644 --- a/src/routes/photos/+page.svelte +++ b/src/routes/photos/+page.svelte @@ -32,8 +32,9 @@ export let data: PageData - let { photos }: { photos: any[] } = data - const { totalPhotos, filteredCountryExists }: { totalPhotos: number, filteredCountryExists: boolean } = data + let { photos, totalPhotos }: { photos: any[], totalPhotos: number } = data + $: ({ photos, totalPhotos } = data) + const { filteredCountryExists }: { totalPhotos: number, filteredCountryExists: boolean } = data const { countries, locations }: any = getContext('global') dayjs.extend(relativeTime) @@ -266,7 +267,7 @@ }) }, { threshold: 0.25, - rootMargin: '0px 0px 10%' + rootMargin: '0px 0px 15%' }) // Photos MutationObserver