fix: page indicator stuck on page 1 due to stale closure

The IntersectionObserver callback was using currentPage from closure to
initialize mostVisiblePage, but this was always stale (stuck at 0).

Changed to start mostVisiblePage at 0 instead of currentPage, so it
correctly tracks the most visible page across all entries without
relying on stale state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2025-11-11 15:21:42 -06:00
parent ae057eeb24
commit 952ebc7756
1 changed files with 1 additions and 1 deletions

View File

@ -172,7 +172,7 @@ function PreviewContent({ formState, initialData, isScrolling = false }: Workshe
const observer = new IntersectionObserver(
(entries) => {
// Find the most visible page among all entries
let mostVisiblePage = currentPage
let mostVisiblePage = 0
let maxRatio = 0
entries.forEach((entry) => {