clean
This commit is contained in:
@@ -441,15 +441,9 @@ function PdfPageCanvas({
|
|||||||
|| undefined;
|
|| undefined;
|
||||||
const observer = new IntersectionObserver((entries) => {
|
const observer = new IntersectionObserver((entries) => {
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
console.log('[PdfViewer] intersection', {
|
|
||||||
page: descriptor.number,
|
|
||||||
isIntersecting: entry.isIntersecting,
|
|
||||||
ratio: entry.intersectionRatio,
|
|
||||||
});
|
|
||||||
if (!entry.isIntersecting || hasRenderedRef.current) {
|
if (!entry.isIntersecting || hasRenderedRef.current) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('[PdfViewer] rendering page', descriptor.number);
|
|
||||||
void renderPage();
|
void renderPage();
|
||||||
});
|
});
|
||||||
}, {
|
}, {
|
||||||
@@ -457,7 +451,6 @@ function PdfPageCanvas({
|
|||||||
rootMargin: '200px 0px',
|
rootMargin: '200px 0px',
|
||||||
threshold: 0.1,
|
threshold: 0.1,
|
||||||
});
|
});
|
||||||
console.log('[PdfViewer] observing page', descriptor.number, { rootMargin: '200px 0px', threshold: 0.1 });
|
|
||||||
observer.observe(target);
|
observer.observe(target);
|
||||||
return () => observer.disconnect();
|
return () => observer.disconnect();
|
||||||
}, [renderPage, rootRef, viewportRef]);
|
}, [renderPage, rootRef, viewportRef]);
|
||||||
|
|||||||
Reference in New Issue
Block a user