Skip to content

Native iCloud apps for Windows and Linux, built in Rust. Notes, Reminders, Calendar, Contacts, Drive and Photos, offline and in sync with your iPhone.

Photos: a month near the screen is never left half built

Yashwanth Kamireddid8ab6d144604
diff --git a/src/screens/PhotosView.tsx b/src/screens/PhotosView.tsx
index 1171b13..487dbd3 100644
--- a/src/screens/PhotosView.tsx
+++ b/src/screens/PhotosView.tsx
@@ -659,8 +659,10 @@ const Month = memo(function Month({
};
}
const watch = new IntersectionObserver(
- ([e]) => {
- close = e.isIntersecting;
+ (entries) => {
+ // The latest of what came in one go: a layout that moved it out and back within a
+ // frame comes as two entries, and the first alone left it out — half built for good.
+ close = entries[entries.length - 1].isIntersecting;
if (!close) return;
setNear(true);
void list.need(items[0].index, items[items.length - 1].index);