浏览代码

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>
Valonso 1 年之前
父节点
当前提交
bea287c5b3
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      web/src/lib/components/asset-viewer/intersection-observer.svelte

+ 1 - 1
web/src/lib/components/asset-viewer/intersection-observer.svelte

@@ -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);
           }
           }