clean
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user