fix(web): images not loading on search and gallery (#3902)

* Check all observed entries, not only first

* fix: formatting

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
pull/3948/head
Valonso 2023-09-01 19:39:15 +07:00 committed by GitHub
parent 46c716d450
commit bea287c5b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

@ -18,7 +18,7 @@
const rootMargin = `${top}px ${right}px ${bottom}px ${left}px`; const rootMargin = `${top}px ${right}px ${bottom}px ${left}px`;
const observer = new IntersectionObserver( const observer = new IntersectionObserver(
(entries) => { (entries) => {
intersecting = entries[0].isIntersecting; intersecting = entries.some((entry) => entry.isIntersecting);
if (!intersecting) { if (!intersecting) {
dispatch('hidden', container); dispatch('hidden', container);
} }