From 9dc6de544f02f768f012f19c00fe79daeb934061 Mon Sep 17 00:00:00 2001 From: dragongoose Date: Tue, 30 Sep 2025 15:15:55 -0400 Subject: [PATCH] Fix #133 --- src/mixins.ts | 4 +++- src/views/FollowingView.vue | 30 +++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/mixins.ts b/src/mixins.ts index 6991ce3..1837bb6 100644 --- a/src/mixins.ts +++ b/src/mixins.ts @@ -137,7 +137,9 @@ export async function getParsedFollowing( let res: FollowingStreamer[] = [] - const payloadData = streamers.slice(cursor, cursor + 35) + const start = cursor * 35 + const end = (cursor + 1) * 35 + const payloadData = streamers.slice(start, end) const payload = { streamers: payloadData diff --git a/src/views/FollowingView.vue b/src/views/FollowingView.vue index 6db3524..bdca463 100644 --- a/src/views/FollowingView.vue +++ b/src/views/FollowingView.vue @@ -39,12 +39,14 @@ export default { return } - const cursor = this.data.length / 35 - const maxCursor = follows.length / 35 + const cursor = Math.ceil(this.data.length / 35) + const maxCursor = Math.floor(follows.length / 35) + if (cursor > maxCursor) return const chunk = await getParsedFollowing(follows, cursor) this.data = [...this.data, ...chunk] + console.log(this.data[this.data.length - 1]) } }, async mounted() { @@ -64,10 +66,7 @@ export default {