Skip to content

Commit 9d5c84b

Browse files
authored
fix: trigger initial divina scroll preload on iOS (#723)
## Problem On iOS, opening the DIVINA reader in scroll mode on the first page could leave the second page outside the initial preload window. The first manual page turn then had to fetch and decode that page on demand, which showed a brief loading state. ## Approach Trigger the regular page preload pass immediately after the initial scroll position is synchronized in the iOS scroll reader. This keeps the fix on the existing preload architecture and aligns the iOS initialization path with the macOS path that already warms adjacent pages at first presentation. ## Scope - Update the iOS `ScrollPageView` initial-position sync path to force the first preload pass once the committed item is known - Leave visible-page prioritization and later page-change maintenance behavior unchanged
1 parent 3ee6d74 commit 9d5c84b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

KMReader/Features/Reader/Views/ScrollPageView_iOS.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@
300300
if parent.viewModel.navigationTarget == nil {
301301
scheduleViewModelCommit(for: committedItem)
302302
}
303+
Task { @MainActor [weak self] in
304+
guard let self, self.engine.committedItem == committedItem else { return }
305+
await self.parent.viewModel.preloadPages(bypassThrottle: true)
306+
}
303307
return true
304308
}
305309

0 commit comments

Comments
 (0)