Skip to content

A self-hosted media server and file management system

fix: blurhash doesnt init correctly on backwards navigation, staying blurred until scroll

aminnausin8c121a533442
diff --git a/resources/js/components/lazy/BlurhashImage.vue b/resources/js/components/lazy/BlurhashImage.vue
index 0fce9d43..a3b5e0ba 100644
--- a/resources/js/components/lazy/BlurhashImage.vue
+++ b/resources/js/components/lazy/BlurhashImage.vue
@@ -81,13 +81,16 @@ const setupObserver = () => {
// starts loading image when within {rootMargin} of the viewport and kills observer
observer = new IntersectionObserver(
- ([entry]) => {
- if (!entry.isIntersecting) return;
-
- isVisible.value = true;
- startLoadingIfVisible();
- observer?.disconnect();
- observer = null;
+ (entries) => {
+ for (const entry of entries) {
+ if (entry.isIntersecting) {
+ isVisible.value = true;
+ startLoadingIfVisible();
+ observer?.disconnect();
+ observer = null;
+ break;
+ }
+ }
},
{ rootMargin: props.rootMargin },
);