chiark / gitweb /
Fix an edge case of watching a nearly empty feed.
authorSimon Tatham <anakin@pobox.com>
Tue, 2 Jan 2024 13:39:56 +0000 (13:39 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 2 Jan 2024 17:30:18 +0000 (17:30 +0000)
This just came up when testing against a dev instance, which starts
off with 0 posts anywhere, of course.

src/file.rs

index 774d97c1e7e0d91976277d0a9316705f119e72fe..5773a95fc7e2463f1c3299fbe91f4e271d55c0fe 100644 (file)
@@ -591,6 +591,12 @@ impl<Type: FileType, Source: FileDataSource>
         if self.contents.source.updated(feeds_updated) {
             self.contents.update_items(client);
             self.ensure_enough_rendered();
+
+            // If someone's home feed was almost completely empty,
+            // then adding a new post at the bottom may in fact cause
+            // there to have been a rendering overshoot where there
+            // previously wasn't!
+            self.fix_overshoot_at_top();
         }
     }
 }