From cd3946c494a8c5be3aef16174e3a89cdee66ee07 Mon Sep 17 00:00:00 2001 From: pax Date: Sun, 5 Apr 2026 14:58:06 -0500 Subject: [PATCH] =?UTF-8?q?Fix=20infinite=20scroll=20loading=20multiple=20?= =?UTF-8?q?pages=20=E2=80=94=20lock=20until=20queue=20drained?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep _loading=True during the entire staggered append process. Only unlock after the last post is added to the grid, preventing reached_bottom from triggering new fetches mid-drain. --- booru_viewer/gui/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/booru_viewer/gui/app.py b/booru_viewer/gui/app.py index 9222c1d..eaa1e0e 100644 --- a/booru_viewer/gui/app.py +++ b/booru_viewer/gui/app.py @@ -821,7 +821,6 @@ class BooruApp(QMainWindow): self._status.showMessage(f"{len(self._posts)} results (end)") return self._shown_post_ids.update(p.id for p in posts) - QTimer.singleShot(100, self._clear_loading) if not hasattr(self, '_append_queue'): self._append_queue = [] @@ -862,7 +861,8 @@ class BooruApp(QMainWindow): if self._append_queue: QTimer.singleShot(50, self._drain_append_queue) else: - # All done — prefetch + # All done — unlock loading and prefetch + self._loading = False if self._db.get_setting_bool("prefetch_adjacent"): self._prefetch_adjacent(idx)