fix(web): lecteurs CBZ/CBR et PDF — évaluer la capacité de défilement du cadre à chaque frame de la sync initiale au lieu d'abandonner avant rendu du contenu (6e correctif bug #39)

This commit is contained in:
Git Agent
2026-08-26 11:59:29 +02:00
parent 1865be5bd9
commit 3cac26c1fa
2 changed files with 2 additions and 4 deletions

View File

@ -115,13 +115,12 @@ export function CbzReader({
const scheduleInitialVisibleSync = useCallback(
(stage: HTMLElement) => {
clearVerticalInitialSync();
if (!(stage.scrollHeight > stage.clientHeight)) return;
verticalInitialSyncAttemptRef.current = 0;
const sync = () => {
verticalInitialSyncFrameRef.current = null;
if (verticalUserScrollRef.current || verticalInitialSyncDoneRef.current) return;
if (verticalTrackingReadyRef.current && stage.scrollTop > Math.max(32, stage.clientHeight * 0.5)) {
if (verticalTrackingReadyRef.current && stage.scrollHeight > stage.clientHeight && stage.scrollTop > Math.max(32, stage.clientHeight * 0.5)) {
commitVisiblePage(stage, true);
}
verticalInitialSyncAttemptRef.current += 1;