Distance tweaks for hidden loads
All checks were successful
Deploy / Deploy (push) Successful in 28s

This commit is contained in:
Astra 2025-04-22 03:53:05 +00:00
parent cff9eed1a4
commit 5eca07724e

View file

@ -18,6 +18,7 @@
// Infinite loading function
const onInfinite = ({ detail: { loaded, complete } } : { detail : { loaded : () => void, complete : () => void}}) => {
getNextPosts().then((newPosts) => {
console.log("Loading next posts...");
if (newPosts.length > 0) {
posts = [...posts, ...newPosts];
loaded();
@ -53,7 +54,7 @@
<PostComponent post={postObject as Post} />
{/each}
<InfiniteLoading on:infinite={onInfinite}
distance={0}
distance={3000}
/>
<div id="spacer"></div>
</div>