Distance tweaks for hidden loads
All checks were successful
Deploy / Deploy (push) Successful in 28s
All checks were successful
Deploy / Deploy (push) Successful in 28s
This commit is contained in:
parent
cff9eed1a4
commit
5eca07724e
1 changed files with 2 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue