Fix Photos page data reactivity and IntersectionObserver rootmargin

This commit is contained in:
2022-08-31 18:35:46 +02:00
parent 1de3c717b2
commit 9f6bf8d97a

View File

@@ -32,8 +32,9 @@
export let data: PageData export let data: PageData
let { photos }: { photos: any[] } = data let { photos, totalPhotos }: { photos: any[], totalPhotos: number } = data
const { totalPhotos, filteredCountryExists }: { totalPhotos: number, filteredCountryExists: boolean } = data $: ({ photos, totalPhotos } = data)
const { filteredCountryExists }: { totalPhotos: number, filteredCountryExists: boolean } = data
const { countries, locations }: any = getContext('global') const { countries, locations }: any = getContext('global')
dayjs.extend(relativeTime) dayjs.extend(relativeTime)
@@ -266,7 +267,7 @@
}) })
}, { }, {
threshold: 0.25, threshold: 0.25,
rootMargin: '0px 0px 10%' rootMargin: '0px 0px 15%'
}) })
// Photos MutationObserver // Photos MutationObserver