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!!
|
if (loading) return; // no spamming!!
|
||||||
loading = true;
|
loading = true;
|
||||||
|
|
||||||
// if (!clean && get(timeline).length > 0)
|
if(clean) {
|
||||||
// last_post = get(timeline)[get(timeline).length - 1].id;
|
timeline.set([]);
|
||||||
|
last_post = false;
|
||||||
|
}
|
||||||
|
|
||||||
let timeline_data;
|
let timeline_data;
|
||||||
switch(timelineType) {
|
switch(timelineType) {
|
||||||
|
@ -47,10 +49,7 @@ export async function getTimeline(timelineType = "home", clean, localOnly = fals
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clean) {
|
if (!clean) {
|
||||||
timeline.set([]);
|
|
||||||
last_post = false;
|
|
||||||
} else {
|
|
||||||
last_post = timeline_data.next.url.searchParams.get("max_id")
|
last_post = timeline_data.next.url.searchParams.get("max_id")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,10 @@
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<div class="flex-row">
|
<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">
|
<svelte:fragment slot="icon">
|
||||||
<FavouritesIcon/>
|
<FavouritesIcon/>
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
const lang = Lang();
|
const lang = Lang();
|
||||||
if (!$account) goto("/");
|
if (!$account) goto("/");
|
||||||
|
|
||||||
getTimeline("favourites");
|
getTimeline("favourites", true);
|
||||||
|
|
||||||
document.addEventListener('scroll', () => {
|
document.addEventListener('scroll', () => {
|
||||||
if ($account && $page.url.pathname !== "/favourites") return;
|
if ($account && $page.url.pathname !== "/favourites") return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue