Skip to content

Commit

Permalink
fix infinite scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Oct 15, 2023
1 parent 4a4d2a5 commit eed4979
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion kitsune-fe/src/graphql/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function getHome(after: Ref<string>) {
}
`),
variables: {
after: after as unknown as string,
after: after as unknown as string, // Weird cast to allow reactivity
},
});

Expand Down
4 changes: 1 addition & 3 deletions kitsune-fe/src/views/timeline/FederatedPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
const localTimelineQuery = getPublic(lastPostId, false);
watch(localTimelineQuery, (newTimelineQuery) => {
(newTimelineQuery?.publicTimeline.nodes ?? []).forEach((post) =>
posts.value.push(post),
);
posts.value = newTimelineQuery?.publicTimeline.nodes ?? [];
});
async function loadMore(): Promise<void> {
Expand Down
4 changes: 1 addition & 3 deletions kitsune-fe/src/views/timeline/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
const homeTimelineQuery = getHome(lastPostId);
watch(homeTimelineQuery, (newTimelineQuery) => {
(newTimelineQuery?.homeTimeline.nodes ?? []).forEach((post) =>
posts.value.push(post),
);
posts.value = newTimelineQuery?.homeTimeline.nodes ?? [];
});
async function loadMore(): Promise<void> {
Expand Down
4 changes: 1 addition & 3 deletions kitsune-fe/src/views/timeline/LocalPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
const localTimelineQuery = getPublic(lastPostId, true);
watch(localTimelineQuery, (newTimelineQuery) => {
(newTimelineQuery?.publicTimeline.nodes ?? []).forEach((post) =>
posts.value.push(post),
);
posts.value = newTimelineQuery?.publicTimeline.nodes ?? [];
});
async function loadMore(): Promise<void> {
Expand Down

0 comments on commit eed4979

Please sign in to comment.