Skip to content

Fix Load More button not working after first click#144

Open
tarcode2004 wants to merge 3 commits intodevfrom
tarcode2004/bug/issue-130-fix-load-more-button
Open

Fix Load More button not working after first click#144
tarcode2004 wants to merge 3 commits intodevfrom
tarcode2004/bug/issue-130-fix-load-more-button

Conversation

@tarcode2004
Copy link
Collaborator

Summary

  • Fixed revalidate() in PostList.tsx resetting the maxId pagination cursor to only the first page of fresh posts, which broke "Load more" after navigating back
  • maxId is now computed from the full merged list (fresh posts + previously loaded posts) so the pagination cursor is preserved across navigations

Test plan

  • Go to /home, confirm posts load
  • Click "Load more" — confirm new posts append
  • Navigate to a post detail page, then press back to /home
  • Click "Load more" again — confirm it loads the next page of posts, not duplicates
  • Repeat navigation and load-more to verify it keeps working

Closes #130

…on` label across skill definitions and conventions
The revalidate() function was resetting maxId to the last post of only
the fresh first-page fetch, discarding the pagination cursor from prior
Load More clicks. Now maxId is computed from the full merged list.
@vercel
Copy link

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
client Ready Ready Preview, Comment Mar 4, 2026 8:34am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

the load button is not working after first time click

1 participant