From 6368d1feeea00f0b30d18c2d132d25195d256964 Mon Sep 17 00:00:00 2001 From: zarzet Date: Tue, 28 Jul 2026 12:51:50 +0700 Subject: [PATCH] fix(library): retain cached rows across refresh --- lib/screens/queue_tab.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/screens/queue_tab.dart b/lib/screens/queue_tab.dart index 7a0c23df..2cc77480 100644 --- a/lib/screens/queue_tab.dart +++ b/lib/screens/queue_tab.dart @@ -412,8 +412,12 @@ class _QueueTabState extends ConsumerState { int _libraryPageOffsetFor(String filterMode) => _libraryPageOffsetByFilter[filterMode] ?? 0; - void _resetLibraryPaging() { + void _resetLibraryOffsets() { _libraryPageOffsetByFilter.clear(); + } + + void _resetLibraryPaging() { + _resetLibraryOffsets(); _queueLibraryPageDataCache.clear(); } @@ -1188,7 +1192,7 @@ class _QueueTabState extends ConsumerState { // The family provider already reruns for the new revision. Retain its // last successful page while SQLite is loading so metadata backfills // and download completions cannot flash the Library as empty. - _resetLibraryPaging(); + _resetLibraryOffsets(); if (mounted) setState(() {}); }, ); @@ -1197,7 +1201,7 @@ class _QueueTabState extends ConsumerState { (previous, next) { if (previous == null || previous == next) return; // Keep stale rows visible until the refreshed query replaces them. - _resetLibraryPaging(); + _resetLibraryOffsets(); if (mounted) setState(() {}); }, );