This commit is contained in:
2025-11-16 21:28:47 +01:00
parent fa6b4b94f6
commit 16c28bcba1
-7
View File
@@ -441,15 +441,9 @@ function PdfPageCanvas({
|| undefined;
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
console.log('[PdfViewer] intersection', {
page: descriptor.number,
isIntersecting: entry.isIntersecting,
ratio: entry.intersectionRatio,
});
if (!entry.isIntersecting || hasRenderedRef.current) {
return;
}
console.log('[PdfViewer] rendering page', descriptor.number);
void renderPage();
});
}, {
@@ -457,7 +451,6 @@ function PdfPageCanvas({
rootMargin: '200px 0px',
threshold: 0.1,
});
console.log('[PdfViewer] observing page', descriptor.number, { rootMargin: '200px 0px', threshold: 0.1 });
observer.observe(target);
return () => observer.disconnect();
}, [renderPage, rootRef, viewportRef]);