fix: timing update on timeline fetcher
This commit is contained in:
parent
3b8ca902f1
commit
ea1a492dc0
3 changed files with 10 additions and 8 deletions
|
@ -16,8 +16,10 @@ export async function getTimeline(timelineType = "home", clean, localOnly = fals
|
|||
if (loading) return; // no spamming!!
|
||||
loading = true;
|
||||
|
||||
// if (!clean && get(timeline).length > 0)
|
||||
// last_post = get(timeline)[get(timeline).length - 1].id;
|
||||
if(clean) {
|
||||
timeline.set([]);
|
||||
last_post = false;
|
||||
}
|
||||
|
||||
let timeline_data;
|
||||
switch(timelineType) {
|
||||
|
@ -47,10 +49,7 @@ export async function getTimeline(timelineType = "home", clean, localOnly = fals
|
|||
return;
|
||||
}
|
||||
|
||||
if (clean) {
|
||||
timeline.set([]);
|
||||
last_post = false;
|
||||
} else {
|
||||
if (!clean) {
|
||||
last_post = timeline_data.next.url.searchParams.get("max_id")
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,10 @@
|
|||
</Button>
|
||||
|
||||
<div class="flex-row">
|
||||
<Button centered label="{lang.string('navigation.favourites')}" disabled>
|
||||
<Button centered
|
||||
label="{lang.string('navigation.favourites')}"
|
||||
href="/favourites"}
|
||||
active={$page.url.pathname === "/favourites"}>
|
||||
<svelte:fragment slot="icon">
|
||||
<FavouritesIcon/>
|
||||
</svelte:fragment>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
const lang = Lang();
|
||||
if (!$account) goto("/");
|
||||
|
||||
getTimeline("favourites");
|
||||
getTimeline("favourites", true);
|
||||
|
||||
document.addEventListener('scroll', () => {
|
||||
if ($account && $page.url.pathname !== "/favourites") return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue